mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
4.4 KiB
JavaScript
2 lines
4.4 KiB
JavaScript
/*! For license information please see 2553.d2840073.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["2553"],{20455:function(e,l,t){"use strict";t.r(l);var a=t("67052");t("70215");let o=a.Z;l.default=o},67052:function(e,l,t){"use strict";var a=t("80681"),o=t("11848"),u=t("41936"),i=t("99742"),n=t("96528"),d=t("54369"),m=t("45802"),s={class:"icon-wrapper"};l.Z=(0,a.aZ)({__name:"index",setup(e){var l=(0,d.q)({"zh-CN":{title:"\u6807\u9898",confirm:"\u63D0\u9192",message:"\u662F\u5426\u5207\u6362\u5F00\u5173\uFF1F",withCell:"\u642D\u914D\u5355\u5143\u683C\u4F7F\u7528",customSize:"\u81EA\u5B9A\u4E49\u5927\u5C0F",customNode:"\u81EA\u5B9A\u4E49\u6309\u94AE",customColor:"\u81EA\u5B9A\u4E49\u989C\u8272",asyncControl:"\u5F02\u6B65\u63A7\u5236"},"en-US":{title:"Title",confirm:"Confirm",message:"Are you sure to toggle switch?",withCell:"Inside a Cell",customSize:"Custom Size",customNode:"Custom Node",customColor:"Custom Color",asyncControl:"Async Control"}}),t=(0,o.iH)(!0),r=(0,o.iH)(!0),c=(0,o.iH)(!0),v=(0,o.iH)(!0),V=(0,o.iH)(!0),U=e=>{(0,m.WD)({title:l("title"),message:l("message")}).then(()=>{v.value=e})};return(e,d)=>{var m=(0,a.up)("demo-block");return(0,a.wg)(),(0,a.iD)(a.HY,null,[(0,a.Wm)(m,{title:(0,o.SU)(l)("basicUsage")},{default:(0,a.w5)(()=>[(0,a.Wm)((0,o.SU)(u.ZP),{modelValue:t.value,"onUpdate:modelValue":d[0]||(d[0]=e=>t.value=e)},null,8,["modelValue"])]),_:1},8,["title"]),(0,a.Wm)(m,{title:(0,o.SU)(l)("disabled")},{default:(0,a.w5)(()=>[(0,a.Wm)((0,o.SU)(u.ZP),{modelValue:t.value,"onUpdate:modelValue":d[1]||(d[1]=e=>t.value=e),disabled:""},null,8,["modelValue"])]),_:1},8,["title"]),(0,a.Wm)(m,{title:(0,o.SU)(l)("loadingStatus")},{default:(0,a.w5)(()=>[(0,a.Wm)((0,o.SU)(u.ZP),{modelValue:t.value,"onUpdate:modelValue":d[2]||(d[2]=e=>t.value=e),loading:""},null,8,["modelValue"])]),_:1},8,["title"]),(0,a.Wm)(m,{title:(0,o.SU)(l)("customSize")},{default:(0,a.w5)(()=>[(0,a.Wm)((0,o.SU)(u.ZP),{modelValue:r.value,"onUpdate:modelValue":d[3]||(d[3]=e=>r.value=e),size:"22px"},null,8,["modelValue"])]),_:1},8,["title"]),(0,a.Wm)(m,{title:(0,o.SU)(l)("customColor")},{default:(0,a.w5)(()=>[(0,a.Wm)((0,o.SU)(u.ZP),{modelValue:c.value,"onUpdate:modelValue":d[4]||(d[4]=e=>c.value=e),"active-color":"#ee0a24","inactive-color":"#dcdee0"},null,8,["modelValue"])]),_:1},8,["title"]),(0,a.Wm)(m,{title:(0,o.SU)(l)("customNode")},{default:(0,a.w5)(()=>[(0,a.Wm)((0,o.SU)(u.ZP),{modelValue:c.value,"onUpdate:modelValue":d[5]||(d[5]=e=>c.value=e)},{node:(0,a.w5)(()=>[(0,a._)("div",s,[(0,a.Wm)((0,o.SU)(n.ZP),{name:c.value?"success":"cross"},null,8,["name"])])]),_:1},8,["modelValue"])]),_:1},8,["title"]),(0,a.Wm)(m,{title:(0,o.SU)(l)("asyncControl")},{default:(0,a.w5)(()=>[(0,a.Wm)((0,o.SU)(u.ZP),{"model-value":v.value,"onUpdate:modelValue":U},null,8,["model-value"])]),_:1},8,["title"]),(0,a.Wm)(m,{title:(0,o.SU)(l)("withCell")},{default:(0,a.w5)(()=>[(0,a.Wm)((0,o.SU)(i.ZP),{center:"",title:(0,o.SU)(l)("title")},{"right-icon":(0,a.w5)(()=>[(0,a.Wm)((0,o.SU)(u.ZP),{modelValue:V.value,"onUpdate:modelValue":d[6]||(d[6]=e=>V.value=e)},null,8,["modelValue"])]),_:1},8,["title"])]),_:1},8,["title"])],64)}}})},41936:function(e,l,t){"use strict";t.d(l,{rs:function(){return u}});var a=t("63112"),o=t("79960"),u=(0,a.n)(o.Z);l.ZP=u},79960:function(e,l,t){"use strict";t("82116"),t("17989");var a=t("80681"),o=t("62568"),u=t("78335"),i=t("20358"),n=t("22300"),d=t("95786"),[m,s]=(0,o.do)("switch"),r={size:u.Or,loading:Boolean,disabled:Boolean,modelValue:u.Vg,activeColor:String,inactiveColor:String,activeValue:{type:u.Vg,default:!0},inactiveValue:{type:u.Vg,default:!1}};l.Z=(0,a.aZ)({name:m,props:r,emits:["change","update:modelValue"],setup(e,l){var{emit:t,slots:o}=l,u=()=>e.modelValue===e.activeValue,m=()=>{if(!e.disabled&&!e.loading){var l=u()?e.inactiveValue:e.activeValue;t("update:modelValue",l),t("change",l)}},r=()=>{if(e.loading){var l=u()?e.activeColor:e.inactiveColor;return(0,a.Wm)(d.gb,{class:s("loading"),color:l},null)}if(o.node)return o.node()};return(0,n.aM)(()=>e.modelValue),()=>{var l,{size:t,loading:n,disabled:d,activeColor:c,inactiveColor:v}=e,V=u(),U={fontSize:(0,i.Nn)(t),backgroundColor:V?c:v};return(0,a.Wm)("div",{role:"switch",class:s({on:V,loading:n,disabled:d}),style:U,tabindex:d?void 0:0,"aria-checked":V,onClick:m},[(0,a.Wm)("div",{class:s("node")},[r()]),null===(l=o.background)||void 0===l?void 0:l.call(o)])}}})},70215:function(e,l,t){"use strict";t.r(e.exports={})},56002:function(e,l,t){"use strict";t.r(e.exports={})}}]); |