UNPKG

various-ui

Version:

This is a test version of the Vue 3 component library

48 lines (43 loc) 1.52 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var vue = require('vue'); var index$1 = require('../../../constants/index.js'); var index = require('./index.js'); var composable = require('./src/composable.js'); const _hoisted_1 = { class: "ui-checkbox-group" }; const __default__ = vue.defineComponent({ name: "UiCheckboxGroup" }); var _sfc_main = /* @__PURE__ */ vue.defineComponent({ ...__default__, props: index.UiCheckboxGroupPropsOption, emits: index.UiCheckboxGroupEmits, setup(__props, { expose: __expose, emit: __emit }) { const emitter = vue.inject(index$1.UiFormEmitterKey, void 0); const define = __props; const emits = __emit; const { methods, values } = composable.useComposable(define, emits); const { switchMode } = methods; vue.provide(index.UiCheckboxGroupInjectionKey, { define, values, change: (value) => { const index = define.modelValue.findIndex((val) => val == value); if (index != -1) { define.modelValue.splice(index, 1); } else { define.modelValue.push(value); } emits("change"); emitter == null ? void 0 : emitter.emit(define.name || "", "change"); } }); __expose({ switchMode }); ; return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ vue.renderSlot(_ctx.$slots, "default") ]); }; } }); exports.default = _sfc_main; //# sourceMappingURL=index.vue2.js.map