@nuxt/devtools
Version:
<a href="https://devtools.nuxt.com"><img width="1200" alt="Nuxt DevTools" src="https://github-production-user-asset-6210df.s3.amazonaws.com/904724/261577617-a10567bd-ad33-48cc-9bda-9e37dbe1929f.png"></a> <br>
2 lines (1 loc) • 961 B
JavaScript
import{d as o,Y as c,o as r,m as u,G as p,cx as h,f as a,k as l,l as b,ac as m,a8 as f}from"./Bysyzw-g.js";const v=["checked","disabled"],k=["disabled"],V=o({__name:"NSwitch",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(d,{emit:i}){const e=c(d,"modelValue",i,{passive:!0});return(t,s)=>(r(),u("label",{class:"n-switch n-switch-base hover:n-switch-hover n-disabled:n-disabled",checked:a(e)||null,disabled:t.disabled||null},[p(l("input",{"onUpdate:modelValue":s[0]||(s[0]=n=>b(e)?e.value=n:null),type:"checkbox",class:"peer absolute op0",disabled:t.disabled,onKeypress:s[1]||(s[1]=m(n=>e.value=!a(e),["enter"]))},null,40,k),[[h,a(e)]]),s[2]||(s[2]=l("div",{class:"n-switch-slider n-checked:n-switch-slider-checked peer-active:n-active-base peer-focus-visible:n-focus-base n-transition"},[l("div",{class:"n-checked:n-switch-thumb-checked n-switch-thumb n-transition"})],-1)),f(t.$slots,"default")],8,v))}});export{V as _};