layui/package/component/es/collapse/index.js
2022-11-15 09:16:55 +08:00

37 lines
1.6 KiB
JavaScript

import { w as withInstall } from "../badge/index2.js";
import { defineComponent, watch, ref, provide, openBlock, createElementBlock, renderSlot } from "vue";
var index = /* @__PURE__ */ (() => ".layui-collapse{border-width:1px;border-style:solid;border-radius:2px}.layui-colla-content,.layui-colla-item{border-top-width:1px;border-top-style:solid}.layui-colla-item:first-child{border-top:none}.layui-colla-title{position:relative;height:42px;line-height:42px;padding:0 15px 0 35px;color:#333;background-color:var(--global-neutral-color-1);cursor:pointer;font-size:14px;overflow:hidden}.layui-colla-content{padding:10px 15px;line-height:1.6;color:#666}.layui-colla-icon{left:15px;top:0;font-size:14px;position:absolute}\n")();
const _hoisted_1 = { class: "layui-collapse" };
const __default__ = {
name: "LayCollapse"
};
const _sfc_main = defineComponent({
...__default__,
props: {
accordion: { type: Boolean, default: false },
modelValue: { default: () => [] },
collapseTransition: { type: Boolean, default: true }
},
emits: ["update:modelValue", "change"],
setup(__props, { emit }) {
const props = __props;
watch(() => props.modelValue, (val) => {
activeValues.value = [].concat(val);
});
const activeValues = ref([].concat(props.modelValue));
provide("layCollapse", {
accordion: props.accordion,
collapseTransition: props.collapseTransition,
activeValues,
emit
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1, [
renderSlot(_ctx.$slots, "default")
]);
};
}
});
const component = withInstall(_sfc_main);
export { component as default };