@fecp/mobile
Version:
66 lines (65 loc) • 3.16 kB
JavaScript
;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
;/* empty css */
;/* empty css */
;/* empty css */
;/* empty css */
;/* empty css */
;/* empty css */
;/* empty css */
;/* empty css */
const vue = require("vue");
const index = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dropdown-menu/index.js");
const index$1 = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dropdown-item/index.js");
const _sfc_main = {
__name: "DropdownMenu",
props: {
modelValue: {
type: Object,
default: {}
},
options: {
type: Array,
default: []
}
},
emits: ["update:modelValue", "change"],
setup(__props, { emit: __emit }) {
const props = __props;
const emit = __emit;
const activeObj = vue.computed({
get: () => {
return props.modelValue;
},
set: (val) => {
emit("update:modelValue", val);
}
});
function changeItem(value, item) {
emit("change", { ...activeObj.value });
}
return (_ctx, _cache) => {
const _component_van_dropdown_item = index$1.DropdownItem;
const _component_van_dropdown_menu = index.DropdownMenu;
return vue.openBlock(), vue.createBlock(_component_van_dropdown_menu, vue.mergeProps(_ctx.$attrs, {
"swipe-threshold": "4",
"auto-locate": ""
}), {
default: vue.withCtx(() => [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.options, (item) => {
return vue.openBlock(), vue.createBlock(_component_van_dropdown_item, {
modelValue: vue.unref(activeObj)[item.name],
"onUpdate:modelValue": ($event) => vue.unref(activeObj)[item.name] = $event,
title: item.title,
options: item.options,
teleport: "body",
onChange: (value) => changeItem()
}, null, 8, ["modelValue", "onUpdate:modelValue", "title", "options", "onChange"]);
}), 256))
]),
_: 1
}, 16);
};
}
};
exports.default = _sfc_main;