yanzhen-design-vue
Version:
35 lines (34 loc) • 1.05 kB
JavaScript
;
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const vue = require("vue");
const lodashEs = require("lodash-es");
const utilsVue = require("@yanzhen-libs/utils-vue");
const input = require("./input.cjs");
function useInput(props, emit) {
const _ref = vue.ref(null);
const attrs = vue.useAttrs();
const modelValue = vue.useModel(props, "value");
const config = vue.computed(() => lodashEs.pick(props, ...Object.keys(input.AntInput.props)));
const proxyProps = utilsVue.useProxyProps(config, input.AntInput.emits, {
emit,
exclude: ["value"]
// filter: key => {
// switch (key as string) {
// case 'onUpdate:value':
// case 'onUpdate:beginTime':
// case 'onUpdate:endTime':
// return false;
// }
// return true;
// },
});
const propsRef = vue.computed(() => {
return vue.mergeProps(utilsVue.unref(attrs), utilsVue.unref(proxyProps));
});
return {
_ref,
propsRef,
modelValue
};
}
exports.useInput = useInput;