LocaleDropdown-1e98d4e4.js 2.5 KB

1
  1. import{d as D,y as P,r as V,o as d,C as w,a as o,a2 as j,ad as L,ae as y,cJ as S,_ as C,dh as u,di as A,a1 as b,dj as O,dk as R,as as $,c$ as M,e as x,A as p,f as T,c as F,R as J,D as N,E as Q,F as U,Q as q,__tla as B}from"./index-f6fb8e95.js";import{u as k,__tla as G}from"./useIcon-51b67e73.js";import{b as H,E as K,a as W,__tla as X}from"./el-dropdown-item-6c448014.js";let z,E,Y=Promise.all([(()=>{try{return B}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return X}catch{}})()]).then(async()=>{let i,v;i="var(--el-color-black)",E=C(D({name:"ThemeSwitch",__name:"ThemeSwitch",setup(l){const{getPrefixCls:s}=y(),c=s("theme-switch"),a=k({icon:"emojione-monotone:sun",color:"#fde047"}),n=k({icon:"emojione-monotone:crescent-moon",color:"#fde047"}),m=P(),t=V(m.getIsDark),e=r=>{m.setIsDark(r)};return(r,_)=>{const g=S;return d(),w(g,{modelValue:o(t),"onUpdate:modelValue":_[0]||(_[0]=f=>j(t)?t.value=f:null),"active-color":i,"active-icon":o(a),"border-color":i,class:L(o(c)),"inactive-color":i,"inactive-icon":o(n),"inline-prompt":"",onChange:e},null,8,["modelValue","active-icon","class","inactive-icon"])}}}),[["__scopeId","data-v-78cd11f1"],["__file","D:/zx/mall-newfeifan-zx-admin/src/layout/components/ThemeSwitch/src/ThemeSwitch.vue"]]),v=()=>({changeLocale:async l=>{const s=u.global,c=await A(Object.assign({"../../locales/en.ts":()=>b(()=>import("./en-706ee4dd.js"),[]),"../../locales/zh-CN.ts":()=>b(()=>import("./zh-CN-3441a76e.js"),[])}),`../../locales/${l}.ts`);s.setLocaleMessage(l,c.default),(a=>{const n=O();u.mode==="legacy"?u.global.locale=a:u.global.locale.value=a,n.setCurrentLocale({lang:a}),R(a)})(l)}}),z=C(D({name:"LocaleDropdown",__name:"LocaleDropdown",props:{color:$.string.def("")},setup(l){const{getPrefixCls:s}=y(),c=s("locale-dropdown"),a=M(),n=x(()=>a.getLocaleMap),m=x(()=>a.getCurrentLocale),t=e=>{if(e===o(m).lang)return;window.location.reload(),a.setCurrentLocale({lang:e});const{changeLocale:r}=v();r(e)};return(e,r)=>{const _=q,g=K,f=W,I=H;return d(),w(I,{class:L(o(c)),trigger:"click",onCommand:t},{dropdown:p(()=>[T(f,null,{default:p(()=>[(d(!0),F(U,null,J(o(n),h=>(d(),w(g,{key:h.lang,command:h.lang},{default:p(()=>[N(Q(h.name),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:p(()=>[T(_,{class:L([e.$attrs.class,"cursor-pointer !p-0"]),color:l.color,size:18,icon:"ion:language-sharp"},null,8,["class","color"])]),_:1},8,["class"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/layout/components/LocaleDropdown/src/LocaleDropdown.vue"]])});export{z as L,E as T,Y as __tla};