UNPKG

yk-element-components-v2

Version:

121 lines (120 loc) 2.93 kB
function p(a, e, o, s, l, r, c, v) { var t = typeof a == "function" ? a.options : a; e && (t.render = e, t.staticRenderFns = o, t._compiled = !0), s && (t.functional = !0), r && (t._scopeId = "data-v-" + r); var n; if (c ? (n = function(i) { i = i || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !i && typeof __VUE_SSR_CONTEXT__ < "u" && (i = __VUE_SSR_CONTEXT__), l && l.call(this, i), i && i._registeredComponents && i._registeredComponents.add(c); }, t._ssrRegister = n) : l && (n = v ? function() { l.call( this, (t.functional ? this.parent : this).$root.$options.shadowRoot ); } : l), n) if (t.functional) { t._injectStyles = n; var h = t.render; t.render = function(_, d) { return n.call(d), h(_, d); }; } else { var u = t.beforeCreate; t.beforeCreate = u ? [].concat(u, n) : [n]; } return { exports: a, options: t }; } const m = { 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(a) { this.switchValue = a; } }, data() { return { switchValue: this.value }; }, methods: { change(a) { this.$emit("change", a), this.$emit("input", a); }, focus() { this.$refs.switch.focus(); } } }; var C = function() { var e = this, o = e._self._c; return o("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(s) { e.switchValue = s; }, expression: "switchValue" } }); }, g = [], w = /* @__PURE__ */ p( m, C, g, !1, null, null, null, null ); const f = w.exports, S = { install(a) { a.component(f.name, f); } }; export { S as default };