Files
EASYAIuniappNewUI/src/components/firstui/fui-collapse/fui-collapse.vue
T

53 lines
1.1 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<!--本文件由FirstUI授权予佛山市航电梦联网络科技有限公司会员ID1 127营业执照号 9144 060 5M A5 56H 1K XH专用请尊重知识产权勿私下传播违者追究法律责任-->
<view class="fui-collapse__wrap" :style="{background:background}">
<slot></slot>
</view>
</template>
<script>
export default {
name: 'fui-collapse',
emits: ['change'],
props: {
// 是否开启手风琴效果
accordion: {
type: Boolean,
default: false
},
background: {
type: String,
default: 'transparent'
}
},
created() {
this.children = []
},
methods: {
collapseChange(obj, isOpen, idx) {
if (this.accordion && isOpen) {
this.children.forEach((item, index) => {
if (item !== obj) {
item.isOpen = false
}
})
}
this.$emit('change', {
index: idx,
isOpen: isOpen
})
}
}
}
</script>
<style scoped>
.fui-collapse__wrap {
/* #ifndef APP-NVUE */
width: 100%;
display: flex;
/* #endif */
/* #ifdef APP-NVUE */
flex: 1;
/* #endif */
flex-direction: column;
}
</style>