yanzhen-design-vue
Version:
43 lines (42 loc) • 1.51 kB
JavaScript
;
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const vue = require("vue");
const antDesignVue = require("ant-design-vue");
const utilsVue = require("@yanzhen-libs/utils-vue");
const radioGroup = require("./radio-group.cjs");
function useRadioGroup(props, emit) {
const _ref = vue.ref();
const attrs = vue.useAttrs();
const $slots = vue.useSlots();
const checkedRef = utilsVue.useModel(props);
const optionsRef = utilsVue.useOptions();
const config = vue.computed(() => props);
const proxyProps = utilsVue.useProxyProps(config, radioGroup.AntRadioGroup.emits, {
emit(event, ...args) {
switch (event) {
case "update:value":
console.log(props, "propspropsprops");
checkedRef.value = args[0];
break;
default:
emit == null ? void 0 : emit(event, ...args);
}
},
exclude: ["value", "onUpdate:value", "options"]
// filter: key => {
// switch (key as string) {
// case 'onUpdate:value':
// return false;
// }
// return true;
// },
});
const propsRef = vue.computed(() => {
return vue.mergeProps(utilsVue.unref(attrs), utilsVue.unref(proxyProps));
});
function createRadioGroupVNode(props2) {
return vue.h(antDesignVue.RadioGroup, { ...utilsVue.unref(propsRef), ...props2 }, utilsVue.unref($slots));
}
return [{ _ref, $slots, propsRef, checkedRef, optionsRef }, createRadioGroupVNode];
}
exports.useRadioGroup = useRadioGroup;