2 lines
3.9 KiB
JavaScript
2 lines
3.9 KiB
JavaScript
import{E as K,a as V}from"./el-carousel.7303e930.js";import{b as F,c as J,E as T,a as q}from"./article.4329036a.js";import{E as G}from"./el-button.b86b6ea8.js";import{p as H,a as x,q as M,s as w,v as O,o as i,c as b,w as o,x as Q,y as U,u as f,z as W,A as X,B as Y,C as Z,r as k,D as tt,e as _,f as l,j as a,h as m,t as g,k as et,i as at,F as E,G as S,H as st,I as ot,J as nt,K as rt}from"./entry.539d3b49.js";import{E as lt}from"./el-select.a5d06e79.js";import"./el-input.60ea0dae.js";import"./el-popper.6e1fd591.js";import{_ as it}from"./_plugin-vue_export-helper.c27b6911.js";import"./vnode.48eda29e.js";import"./throttle.4fc9319f.js";import"./debounce.7822d733.js";import"./index.e7365e3c.js";import"./use-form-item.aa386fad.js";import"./index.68b3a059.js";const ct=Symbol("rowContextKey"),dt=["start","center","end","space-around","space-between","space-evenly"],pt=["top","middle","bottom"],ut=H({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:dt,default:"start"},align:{type:String,values:pt,default:"top"}}),_t=x({name:"ElRow"}),mt=x({..._t,props:ut,setup(c){const s=c,d=M("row"),p=w(()=>s.gutter);O(ct,{gutter:p});const t=w(()=>{const n={};return s.gutter&&(n.marginRight=n.marginLeft=`-${s.gutter/2}px`),n}),u=w(()=>[d.b(),d.is(`justify-${s.justify}`,s.justify!=="start"),d.is(`align-${s.align}`,s.align!=="top")]);return(n,C)=>(i(),b(X(n.tag),{class:U(f(u)),style:W(f(t))},{default:o(()=>[Q(n.$slots,"default")]),_:3},8,["class","style"]))}});var gt=Y(mt,[["__file","/home/runner/work/element-plus/element-plus/packages/components/row/src/row.vue"]]);const ft=Z(gt);const $=c=>(nt("data-v-8ab95a7d"),c=c(),rt(),c),ht={class:"w-full main-container pt-5"},yt=$(()=>a("div",{class:"h-full index-carousel"},null,-1)),vt={class:"mt-[20px] mb-[50px]"},wt={class:"w-full"},bt={class:"flex mt-[20px] items-start"},xt=$(()=>a("div",{class:"w-[50px]"},"类目:",-1)),Ct=["onClick"],kt={class:"flex justify-between relative py-[20px] border-b-1 border-gray-300 border-solid"},Et={class:"w-[150px] h-[150px] flex items-center"},St=["src"],$t={class:"w-[1030px]"},Bt={class:"text-xl font-bold"},Rt={class:"overflow-ellipsis mt-2 mb-2 tow-line-overflow text-gray-500"},jt=x({__name:"list",setup(c){const s=st(),d=k([]),p=k(),t=tt({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{title:"",category_id:""}}),u=(e=1)=>{t.loading=!0,t.page=e,F({page:t.page,limit:t.limit,...t.searchParam}).then(h=>{t.loading=!1,t.data=h.data.data,t.total=h.data.total}).catch(()=>{t.loading=!1})};u(),(()=>{J().then(e=>{d.value=e.data.data})})();const C=e=>{t.searchParam.category_id=e.category_id,p.value=e.name},B=e=>{u(e)},R=e=>{u(e)},j=e=>{s.push(`/article/detail?id=${e}`)};return(e,h)=>{const z=K,A=V,y=T,N=q,L=G,P=ft,D=lt;return i(),_("div",ht,[l(A,{height:"350px","indicator-position":"none",arrow:"never"},{default:o(()=>[l(z,null,{default:o(()=>[yt]),_:1})]),_:1}),a("div",vt,[a("div",null,[a("div",wt,[l(N,{"separator-icon":f(at)},{default:o(()=>[l(y,{to:{path:"/"}},{default:o(()=>[m("首页")]),_:1}),l(y,{to:{path:"/article/list"}},{default:o(()=>[m("文章")]),_:1}),p.value?(i(),b(y,{key:0},{default:o(()=>[m(g(p.value),1)]),_:1})):et("",!0)]),_:1},8,["separator-icon"]),a("div",bt,[xt,l(P,null,{default:o(()=>[(i(!0),_(E,null,S(d.value,(r,v)=>(i(),b(L,{class:"mb-[10px]",onClick:I=>C(r),key:v},{default:o(()=>[m(g(r.name),1)]),_:2},1032,["onClick"]))),128))]),_:1})]),(i(!0),_(E,null,S(t.data,(r,v)=>(i(),_("div",{class:"article-list mb-[20px] cursor-pointer",key:v,onClick:I=>j(r.id)},[a("div",kt,[a("div",Et,[a("img",{src:("img"in e?e.img:f(ot))(r.image)},null,8,St)]),a("div",$t,[a("p",Bt,g(r.title),1),a("span",Rt,g(r.intro),1)])])],8,Ct))),128)),l(D,{class:"justify-center",onCurrentChange:R,onSizeChange:B,"page-size":t.limit,background:"",layout:"prev, pager, next",total:t.total},null,8,["page-size","total"])])])])])}}});const Ht=it(jt,[["__scopeId","data-v-8ab95a7d"]]);export{Ht as default};
|