UNPKG

@wfrog/vc

Version:

vue3 组件库 vc

86 lines (80 loc) 2.53 kB
import './index.css' import '../../chunk/E_WRn0OP.mjs'; import { E as ElInput } from '../../chunk/D19ZZ4OA.mjs'; import { defineComponent, useCssVars, unref, computed, useCssModule, useTemplateRef, createBlock, openBlock, normalizeClass, createSlots, withCtx, renderSlot } from 'vue'; import { _ as _export_sfc } from '../../chunk/pcqpp-6-.mjs'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "input", props: { block: { type: Boolean, default: false }, width: {} }, setup(__props, { expose: __expose }) { useCssVars((_ctx) => ({ "v5d522f0a": unref(myWidth) })); const props = __props; const $style = useCssModule(); const inputRef = useTemplateRef("inputRef"); const className = computed(() => ({ [$style.input]: true, [$style.block]: props.block })); const myWidth = computed(() => { return props.width || (props.block ? "100%" : "240px"); }); __expose({ inputRef }); return (_ctx, _cache) => { const _component_ElInput = ElInput; return openBlock(), createBlock(_component_ElInput, { ref_key: "inputRef", ref: inputRef, class: normalizeClass(unref(className)) }, createSlots({ _: 2 }, [ _ctx.$slots.prefix ? { name: "prefix", fn: withCtx(() => [ renderSlot(_ctx.$slots, "prefix") ]), key: "0" } : void 0, _ctx.$slots.suffix ? { name: "suffix", fn: withCtx(() => [ renderSlot(_ctx.$slots, "suffix") ]), key: "1" } : void 0, _ctx.$slots.prepend ? { name: "prepend", fn: withCtx(() => [ renderSlot(_ctx.$slots, "prepend") ]), key: "2" } : void 0, _ctx.$slots.append ? { name: "append", fn: withCtx(() => [ renderSlot(_ctx.$slots, "append") ]), key: "3" } : void 0 ]), 1032, ["class"]); }; } }); /* unplugin-vue-components disabled */const input = "_input_youbd_1"; const block = "_block_youbd_5"; const style0 = { input: input, block: block }; const cssModules = { "$style": style0 }; const Component = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]); const __vite_glob_0_21 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ __proto__: null, default: Component }, Symbol.toStringTag, { value: 'Module' })); export { Component as C, __vite_glob_0_21 as _ };