mirror of
https://github.com/PhaseII-eAmusement-Network/PhaseWeb3-Vue.git
synced 2026-07-16 16:54:08 -05:00
3 lines
1.9 KiB
JavaScript
3 lines
1.9 KiB
JavaScript
import{d as k,h as c,u as g,a as v,b as B,r as h,o as $,c as o,e as x,w as l,f as d,T as S,g as e,_ as N,i as C,m as V,j as t,k as u,t as y,F as j,l as A,n as F,p as D,q as I}from"./index.42dc3a62.js";const M=k({name:"BaseButtons",props:{noWrap:Boolean,type:{type:String,default:"justify-start"},classAddon:{type:String,default:"mr-3 last:mr-0 mb-3"},mb:{type:String,default:"-mb-3"}},render(){const m=this.$slots&&this.$slots.default,i=["flex","items-center",this.type,this.noWrap?"flex-nowrap":"flex-wrap"];return this.mb&&i.push(this.mb),c("div",{class:i},m?this.$slots.default().map(s=>s&&s.children&&typeof s.children=="object"?c(s,{},s.children.map(f=>c(f,{class:[this.classAddon]}))):c(s,{class:[this.classAddon]})):null)}}),R={class:"flex flex-col items-center"},T=["src"],W={class:"text-left md:text-center"},q={class:"text-2xl"},z={key:1},H={__name:"PostView",setup(m){const i=g(),s=v(),f=parseInt(i.params.id),w=B();var a=h({data:{}}),p=h("");$(async()=>{try{const r=await w.fetchNews(f);a.value=r.news,p.value=r.news.body.split(`
|
|
`)}catch(r){console.error("Failed to fetch news data:",r)}});function b(){s.push("/")}return(r,n)=>(o(),x(I,null,{default:l(()=>[d(D,null,{default:l(()=>[d(S,null,{default:l(()=>[e(a)!={}?(o(),x(N,{key:0,"has-table":""},{footer:l(()=>[d(M,null,{default:l(()=>[d(C,{label:"Home",color:"info",icon:e(V),"icon-size":"20",onClick:b},null,8,["icon"])]),_:1})]),default:l(()=>[t("div",R,[t("img",{src:e(a).data.img,class:"rounded-t-2xl md:rounded-2xl md:w-1/2 md:m-4"},null,8,T)]),e(a)?(o(),u("div",{key:e(a).id,class:"flex flex-col items-center p-4"},[t("div",W,[t("h1",q,y(e(a).title),1),n[1]||(n[1]=t("hr",{class:"pb-1 my-2"},null,-1)),(o(!0),u(j,null,A(e(p),_=>(o(),u("div",{key:_},[t("p",null,y(_),1),n[0]||(n[0]=t("br",null,null,-1))]))),128))])])):(o(),u("div",z,n[2]||(n[2]=[t("h1",{class:"text-2xl"},"News not found...",-1)])))]),_:1})):F("",!0)]),_:1})]),_:1})]),_:1}))}};export{H as default};
|