yanzhen-design-vue
Version:
32 lines (31 loc) • 1.07 kB
JavaScript
import { defineComponent, openBlock, createBlock, unref, mergeProps, isRef } from "vue";
import { Input } from "ant-design-vue";
import { inputName, inputProps, inputEmits, inputOptions } from "./input.mjs";
import { useInput } from "./use-input.mjs";
const _sfc_main = /* @__PURE__ */ defineComponent({
...{ name: inputName },
__name: "input",
props: inputProps,
emits: inputEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const { ns } = inputOptions;
const props = __props;
const emit = __emit;
const { _ref, propsRef, modelValue } = useInput(props, emit);
__expose({
ref: _ref
});
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(Input), mergeProps({
ref_key: "_ref",
ref: _ref,
value: unref(modelValue),
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
class: [unref(ns).b()]
}, unref(propsRef)), null, 16, ["value", "class"]);
};
}
});
export {
_sfc_main as default
};