| 1 |
- var t=Object.defineProperty,e=Object.prototype.hasOwnProperty,a=Object.getOwnPropertySymbols,s=Object.prototype.propertyIsEnumerable,c=(e,a,s)=>a in e?t(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s,l=(t,l)=>{for(var o in l||(l={}))e.call(l,o)&&c(t,o,l[o]);if(a)for(var o of a(l))s.call(l,o)&&c(t,o,l[o]);return t};import{c as o}from"./mobile.e1ddb172.js";import{a as n,z as r,s as i,x as h,r as d,o as u,c as b,f as w,j as f,t as p,q as j}from"./vendor.80bf15c7.js";import"./index.42d325ee.js";const{createDemo:g}=o("switch");var m=g({props:{},setup(){const t=n({text:"开"});return l(l({},r(t)),{switchChange:(e,a)=>{t.text=a?"开":"关"},change:(t,e)=>{alert(`触发了change事件,开关状态:${e}`)}})}});const v=j("data-v-7bf1ebc0");i("data-v-7bf1ebc0");const x={class:"demo"},y=w("h2",null,"基础用法",-1),_=w("h2",null,"禁用状态",-1),C=w("h2",null,"change事件",-1),O=f(" chane "),S=w("h2",null,"自定义颜色",-1),P=f(" color "),I=w("h2",null,"支持文字",-1),q=f(" text ");h();const z=v(((t,e,a,s,c,l)=>{const o=d("nut-switch"),n=d("nut-cell");return u(),b("div",x,[y,w(n,{class:"switch-adjust"},{default:v((()=>[f(p(t.text)+" ",1),w(o,{onSwitchChange:t.switchChange,class:"switch-decoration"},null,8,["onSwitchChange"])])),_:1}),_,w(n,{class:"switch-adjust"},{default:v((()=>[f(p(t.text)+" ",1),w(o,{class:"switch-decoration",disable:""})])),_:1}),C,w(n,{class:"switch-adjust"},{default:v((()=>[O,w(o,{onSwitchChange:t.change,class:"switch-decoration"},null,8,["onSwitchChange"])])),_:1}),S,w(n,{class:"switch-adjust"},{default:v((()=>[P,w(o,{"active-color":"blue",class:"switch-decoration"})])),_:1}),I,w(n,{class:"switch-adjust"},{default:v((()=>[q,w(o,{class:"switch-decoration",label:"开 关"})])),_:1})])}));m.render=z,m.__scopeId="data-v-7bf1ebc0";export default m;
|