1 |
- import{l as p}from"./forum.184c447c.js";import{b as d,r as l}from"./index.bec96d93.js";const _=["latest","comment","upvote"],f={latest:"id",comment:"comment_count",upvote:"like_count"},T={page:1,limit:10};function M(){const a=d({is_page:1,status:"normal",is_boutique:0,order:"id",order_type:"desc"}),e=l("latest"),o=l([]),i=t=>{_.includes(t)&&(e.value=t,s({page:1,order:f[e.value]}))};async function u(t){try{const{data:c=[]}=await p(t),{total:m=0,page:n=1,limit:v=10,last_page:g,list:r=[]}=c;n>=2?o.value.concat(r):o.value=[...r],a.page=n,a.total-m}catch{}}const s=(t={})=>{u({...a,...T,...t})};return{forumType:e,forumTableData:o,handleLoadForumData:s,handleSwitchForumType:i}}export{M as u};
|