UNPKG

@wfrog/vc

Version:

vue3 组件库 vc

64 lines (58 loc) 2.02 kB
import './index.css' import '../../chunk/E_WRn0OP.mjs'; import '../../chunk/Bm4zCpG6.mjs'; import { E as ElSelect } from '../../chunk/DVg9glNI.mjs'; import '../../chunk/CJQcPuNK.mjs'; import '../../chunk/DUd8IaU9.mjs'; import { defineComponent, useCssVars, unref, computed, useCssModule, createBlock, openBlock, mergeProps } from 'vue'; import { _ as _export_sfc } from '../../chunk/pcqpp-6-.mjs'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "select", props: { block: { type: Boolean, default: false }, width: { default: "" }, options: {} }, setup(__props) { useCssVars((_ctx) => ({ "v16c5a880": unref(myWidth) })); const props = __props; const myOptions = computed(() => { if (Array.isArray(props.options) && typeof props.options[0] === "string") { return props.options.map((item) => ({ label: item, value: item })); } return props.options; }); const $style = useCssModule(); const className = computed(() => ({ [$style.select]: true, [$style.block]: props.block })); const myWidth = computed(() => { return props.width || (props.block ? "100%" : "240px"); }); return (_ctx, _cache) => { const _component_ElSelect = ElSelect; return openBlock(), createBlock(_component_ElSelect, mergeProps({ "collapse-tags": "" }, _ctx.$attrs, { class: unref(className), options: unref(myOptions) }), null, 16, ["class", "options"]); }; } }); /* unplugin-vue-components disabled */const select = "_select_1fcv5_1"; const block = "_block_1fcv5_5"; const style0 = { select: select, block: block }; const cssModules = { "$style": style0 }; const Component = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]); const __vite_glob_0_25 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ __proto__: null, default: Component }, Symbol.toStringTag, { value: 'Module' })); export { Component as C, __vite_glob_0_25 as _ };