123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <template>
- <view class="collapse">
- <view class="header" @click="()=>{show = !show}">
- <view class="title">{{ title }}</view>
- <image :src="icon_arrow_up_black_16" v-if="show" />
- <image :src="icon_arrow_down_black_16" v-if="!show" />
- </view>
- <view class="content" v-if="show">
- <slot></slot>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: 'Collapse',
- props: {
- title: {
- type: String
- }
- },
- data() {
- return {
- icon_arrow_down_black_16: require('../tree-address/img/icon_arrow_down_black_16.svg'),
- icon_arrow_up_black_16: require('../tree-address/img/icon_arrow_up_black_16.svg'),
- show: true
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .collapse {
- background-color: rgba(255, 255, 255, 1);
- border-radius: 16rpx;
- padding: 16rpx;
- margin-top: 16rpx;
- .header {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .title {
- color: rgba(20, 20, 20, 1);
- }
- uni-image {
- width: 32rpx;
- height: 32rpx;
- }
- }
- .content {
- padding: 24rpx 16rpx;
- // display: flex;
- // align-items: center;
- // justify-content: center;
- }
- }
- </style>
|