UNPKG

various-ui

Version:

This is a test version of the Vue 3 component library

64 lines (61 loc) 2.3 kB
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createCommentVNode, createElementVNode, createVNode, renderSlot, createTextVNode, toDisplayString } from 'vue'; import { UiCheckboxPropsOption, UiCheckboxEmits } from './index.mjs'; import { useComposable } from './src/composable.mjs'; import { UiIcon } from '../../icon/index.mjs'; const _hoisted_1 = { class: "ui-checkbox-control" }; const _hoisted_2 = ["value", "checked", "disabled"]; const _hoisted_3 = { class: "ui-checkbox-content" }; const __default__ = defineComponent({ name: "UiCheckbox" }); var _sfc_main = /* @__PURE__ */ defineComponent({ ...__default__, props: UiCheckboxPropsOption, emits: UiCheckboxEmits, setup(__props, { emit: __emit }) { const define = __props; const emits = __emit; const { methods, computeds } = useComposable(define, emits); const { checked, disabled, className } = computeds; const { switchData } = methods; ; return (_ctx, _cache) => { return openBlock(), createElementBlock( "label", { class: normalizeClass(["ui-checkbox", unref(className)]) }, [ createCommentVNode(" \u591A\u9009\u6846\u63A7\u5236\u5668 "), createElementVNode("div", _hoisted_1, [ createElementVNode("input", { type: "checkbox", class: "ui-checkbox-input", value: _ctx.value, checked: unref(checked), disabled: unref(disabled), onChange: _cache[0] || (_cache[0] = //@ts-ignore (...args) => unref(switchData) && unref(switchData)(...args)) }, null, 40, _hoisted_2), createVNode(unref(UiIcon), { name: "success", class: "ui-checkbox-icon" }) ]), createCommentVNode(" \u591A\u9009\u6846\u6587\u6848 "), createElementVNode("div", _hoisted_3, [ renderSlot(_ctx.$slots, "default", {}, () => [ createTextVNode( toDisplayString(_ctx.value), 1 /* TEXT */ ) ]) ]) ], 2 /* CLASS */ ); }; } }); export { _sfc_main as default }; //# sourceMappingURL=index.vue2.mjs.map