UNPKG

@fecp/mobile

Version:

71 lines (70 loc) 2.27 kB
/* empty css */ import { computed, createElementBlock, openBlock, normalizeStyle, unref, createVNode, mergeProps, isRef, createSlots, renderList, withCtx, renderSlot } from "vue"; /* empty css */ import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs"; import { Collapse } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/collapse/index.mjs"; const _sfc_main = { __name: "Collapse", props: { modelValue: { type: String, default: "" }, autoHeight: { //高度自适应 type: Boolean, default: true }, height: { //高度 type: String, default: "300" } }, emits: ["update:modelValue"], setup(__props, { emit: __emit }) { const props = __props; const emit = __emit; const activeName = computed({ get: () => { return props.modelValue; }, set: (val) => { emit("update:modelValue", val); } }); const compHeight = computed(() => { if (props.autoHeight) { return "100%"; } else { return props.height + "px"; } }); return (_ctx, _cache) => { const _component_van_collapse = Collapse; return openBlock(), createElementBlock("div", { class: "fec-collapse-container", style: normalizeStyle("height:" + unref(compHeight)) }, [ createVNode(_component_van_collapse, mergeProps(_ctx.$attrs, { class: "fec-collapse", modelValue: unref(activeName), "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(activeName) ? activeName.value = $event : null) }), createSlots({ _: 2 }, [ renderList(_ctx.$slots, (item, key) => { return { name: key, fn: withCtx(() => [ renderSlot(_ctx.$slots, key, {}, void 0, true) ]) }; }) ]), 1040, ["modelValue"]) ], 4); }; } }; const _Collapse = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ad01a25c"]]); export { _Collapse as default };