yk-element-components-v2
Version:
2 lines (1 loc) • 2.29 kB
JavaScript
(function(o,s){typeof exports=="object"&&typeof module<"u"?module.exports=s():typeof define=="function"&&define.amd?define(s):(o=typeof globalThis<"u"?globalThis:o||self,o.index=s())})(this,function(){"use strict";function o(i,e,r,c,l,d,f,C){var t=typeof i=="function"?i.options:i;e&&(t.render=e,t.staticRenderFns=r,t._compiled=!0),c&&(t.functional=!0),d&&(t._scopeId="data-v-"+d);var a;if(f?(a=function(n){n=n||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!n&&typeof __VUE_SSR_CONTEXT__<"u"&&(n=__VUE_SSR_CONTEXT__),l&&l.call(this,n),n&&n._registeredComponents&&n._registeredComponents.add(f)},t._ssrRegister=a):l&&(a=C?function(){l.call(this,(t.functional?this.parent:this).$root.$options.shadowRoot)}:l),a)if(t.functional){t._injectStyles=a;var g=t.render;t.render=function(w,h){return a.call(h),g(w,h)}}else{var v=t.beforeCreate;t.beforeCreate=v?[].concat(v,a):[a]}return{exports:i,options:t}}const s={name:"yk-switch",props:{value:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:!1},width:{type:Number,default:40},activeIconClass:{type:String,default:""},inactiveIconClass:{type:String,default:""},activeText:String,inactiveText:String,activeColor:{type:String,default:""},inactiveColor:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},id:String},watch:{value(i){this.switchValue=i}},data(){return{switchValue:this.value}},methods:{change(i){this.$emit("change",i),this.$emit("input",i)},focus(){this.$refs.switch.focus()}}};var p=function(){var e=this,r=e._self._c;return r("el-switch",{ref:"switch",attrs:{disabled:e.disabled,width:e.width,activeIconClass:e.activeIconClass,inactiveIconClass:e.inactiveIconClass,activeText:e.activeText,inactiveText:e.inactiveText,activeColor:e.activeColor,inactiveColor:e.inactiveColor,activeValue:e.activeValue,inactiveValue:e.inactiveValue,name:e.name,validateEvent:e.validateEvent,id:e.id},on:{change:e.change},model:{value:e.switchValue,callback:function(c){e.switchValue=c},expression:"switchValue"}})},_=[],m=o(s,p,_,!1,null,null,null,null);const u=m.exports;return{install(i){i.component(u.name,u)}}});