-
Notifications
You must be signed in to change notification settings - Fork 1
/
YunPostList.vue_vue_type_style_index_0_lang-3a34de52.js
1 lines (1 loc) · 4.11 KB
/
YunPostList.vue_vue_type_style_index_0_lang-3a34de52.js
1
import{h as $,T as m,l as z,o as s,g as o,c as d,w as f,e as r,F as P,i as x,d as C,t as b,m as y,a as i,k as L,V,j as h,b as v,n as Y,f as j,a3 as T,U as B,a4 as M}from"./app-4433fae6.js";import{_ as N}from"./YunCard.vue_vue_type_style_index_0_lang-e4df850e.js";import{_ as F,a as H,b as A}from"./YunPostMeta.vue_vue_type_style_index_0_lang-c1e6a0a4.js";const D={class:"pagination"},E=i("div",{"i-ri-arrow-left-s-line":""},null,-1),G=i("div",{"i-ri-arrow-right-s-line":""},null,-1),I=$({__name:"ValaxyPagination",props:{curPage:{},total:{},pageSize:{}},emits:["pageChange"],setup(g,{emit:u}){const n=g,c=m(()=>Math.ceil(n.total/n.pageSize)),l=m(()=>n.curPage===1||n.curPage===c.value?3:2);function t(e){return e===1||e===c.value?!0:e>n.curPage-l.value&&e<n.curPage+l.value}function p(e){return u("pageChange",e),e===1?"/":`/page/${e}`}return(e,k)=>{const _=z("router-link");return s(),o("nav",D,[e.curPage!==1?(s(),d(_,{key:0,class:"page-number",to:p(e.curPage-1),"aria-label":"prev"},{default:f(()=>[E]),_:1},8,["to"])):r("v-if",!0),(s(!0),o(P,null,x(c.value,a=>(s(),o(P,null,[t(a)?(s(),d(_,{key:a,class:y(["page-number",e.curPage===a&&"active"]),to:p(a)},{default:f(()=>[C(b(a),1)]),_:2},1032,["class","to"])):a===e.curPage-l.value?(s(),o("span",{key:`prev-space-${a}`,class:"space",disabled:""}," ... ")):a===e.curPage+l.value?(s(),o("span",{key:`next-space-${a}`,class:"space",disabled:""}," ... ")):r("v-if",!0)],64))),256)),e.curPage!==c.value?(s(),d(_,{key:1,class:"page-number",to:p(e.curPage+1),"aria-label":"next"},{default:f(()=>[G]),_:1},8,["to"])):r("v-if",!0)])}}});const U={class:"flex flex-1 of-hidden justify-start items-start post-card-info",w:"full"},q=["src","alt"],J={class:"flex-center title text-2xl",text:"center",font:"serif black"},K={key:0,py:"1"},O=["innerHTML"],Q=i("div",{m:"b-5"},null,-1),R=["href"],W={w:"full",class:"yun-card-actions flex justify-between",border:"t",text:"sm"},X={class:"post-categories inline-flex",flex:"wrap 1"},Z={class:"post-tags inline-flex",flex:"wrap 1",justify:"end",m:"1"},ee=$({__name:"YunPostCard",props:{post:{}},setup(g){const u=g,{t:n}=L(),{icon:c,styles:l}=V(u.post.type);return(t,p)=>{const e=j,k=F,_=H,a=A,w=N;return s(),d(w,{m:"y-4 auto",class:y(t.post.cover?"post-card-image":"post-card"),style:Y(h(l))},{default:f(()=>[i("div",U,[t.post.cover?(s(),o("img",{key:0,src:t.post.cover,alt:h(n)("post.cover"),width:"320",height:"180",w:"40%",h:"54",class:"cover object-cover object-center md:shadow"},null,8,q)):r("v-if",!0),i("div",{class:y(["flex flex-col flex-1 items-center",t.post.cover&&"max-h-54"]),w:"full"},[v(e,{class:"post-title-link cursor-pointer",to:t.post.path||"",m:"t-3"},{default:f(()=>[i("div",J,[t.post.type?(s(),o("div",{key:0,class:y(["inline-flex",h(c)]),m:"r-1"},null,2)):r("v-if",!0),C(b(t.post.title),1)])]),_:1},8,["to"]),v(k,{frontmatter:t.post},null,8,["frontmatter"]),t.post.excerpt_type==="text"?(s(),o("div",K)):r("v-if",!0),t.post.excerpt?(s(),o("div",{key:1,class:"markdown-body",text:"left",w:"full",p:"x-6 lt-sm:4 y-1",innerHTML:t.post.excerpt},null,8,O)):r("v-if",!0),Q,t.post.url?(s(),o("a",{key:2,href:t.post.url,class:"post-link-btn shadow hover:shadow-md",rounded:"",target:"_blank",m:"b-4"},b(h(n)("post.view_link")),9,R)):r("v-if",!0)],2)]),r(" always show "),i("div",W,[i("div",X,[v(_,{m:"l-1",categories:t.post.categories},null,8,["categories"])]),i("div",Z,[t.post.tags?(s(),d(a,{key:0,tags:t.post.tags},null,8,["tags"])):r("v-if",!0)])])]),_:1},8,["class","style"])}}}),te={class:"yun-post-list",w:"full",p:"x-4 lt-sm:0"},se={key:0,py2:"",op50:""},re=$({__name:"YunPostList",props:{type:{},posts:{},curPage:{default:1}},setup(g){const u=g,n=T(),c=B(),l=m(()=>c.value.pageSize),t=m(()=>(u.posts||n.postList).filter(e=>!e.hide)),p=m(()=>t.value.slice((u.curPage-1)*l.value,u.curPage*l.value));return(e,k)=>{const _=ee,a=I;return s(),o(P,null,[i("div",te,[p.value.length?r("v-if",!0):(s(),o("div",se," 博主还什么都没写哦~ ")),v(M,{name:"fade"},{default:f(()=>[(s(!0),o(P,null,x(p.value,(w,S)=>(s(),d(_,{key:S,post:w},null,8,["post"]))),128))]),_:1})]),v(a,{"cur-page":e.curPage,"page-size":l.value,total:t.value.length},null,8,["cur-page","page-size","total"])],64)}}});export{re as _};