UNPKG

various-ui

Version:

This is a test version of the Vue 3 component library

65 lines (62 loc) 2.23 kB
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createCommentVNode, createElementVNode, renderSlot, createTextVNode, toDisplayString } from 'vue'; import { UiRadioPropsOption, UiRadioEmits } from './index.mjs'; import { useComposable } from './src/composable.mjs'; const _hoisted_1 = { class: "ui-radio-control" }; const _hoisted_2 = ["value", "checked"]; const _hoisted_3 = { class: "ui-radio-content" }; const __default__ = defineComponent({ name: "UiRadio" }); var _sfc_main = /* @__PURE__ */ defineComponent({ ...__default__, props: UiRadioPropsOption, emits: UiRadioEmits, setup(__props, { emit: __emit }) { const define = __props; const emits = __emit; const { methods, computeds } = useComposable(define, emits); const { switchRatio } = methods; const { className, checked } = computeds; ; return (_ctx, _cache) => { return openBlock(), createElementBlock( "label", { class: normalizeClass(["ui-radio", unref(className)]) }, [ createCommentVNode(" \u591A\u9009\u6846\u63A7\u5236\u5668 "), createElementVNode("div", _hoisted_1, [ _cache[1] || (_cache[1] = createElementVNode( "div", { class: "ui-radio-circle" }, null, -1 /* HOISTED */ )), createElementVNode("input", { type: "radio", class: "ui-radio-input", value: _ctx.value, checked: unref(checked), onChange: _cache[0] || (_cache[0] = //@ts-ignore (...args) => unref(switchRatio) && unref(switchRatio)(...args)) }, null, 40, _hoisted_2) ]), 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