<template>
	<view class="my-collapse-card">
		<view class="my-collapse-item" :class="{'item-open': open}">
			<text class="collapse-text">{{title}}</text>
			<icon class="collapse-item-icon" :style="{ backgroundImage: 'url(' + imgsArr.navBarJtIcon + ')' }"></icon>
		</view>
		<view class="my-card-content" :class="{'content-open': open}">
			<slot></slot>
		</view>
	</view>
</template>

<script>
	import cacheManager from '@/utils/cacheManager.js';
	export default {
		name: "myCollapseCard",
		props: {
			title: {
				type: String
			},
			open: {
				type:Boolean
			}
		},
		data() {
		    return {
		      // 初始化 imgsArr，设置默认空对象
		      imgsArr: { navBarJtIcon: '' }
		    }
		  },
		  created() {
		  		this.imgsArr.navBarJtIcon = cacheManager.get('projectImg').nav_bar_jt_bottom;
		  	},
	}
</script>
