// 底部tab active状态保持
import HomeIcon from '@/assets/icon/首页.png';
const HomeIconActive = require('@/assets/icon/首页-选中.png');
const WorkbenchIcon = require('@/assets/icon/工作台.png');
const WorkbenchIconActive = require('@/assets/icon/工作台-选中.png');
const AlarmIcon = require('@/assets/icon/报警.png');
const AlarmIconActive = require('@/assets/icon/报警-选中.png');
const MineIcon = require('@/assets/icon/我的.png');
const MineIconActive = require('@/assets/icon/我的-选中.png');
console.log(HomeIcon)
const TAB_LIST = [
{ name: 'index', label: '首页', icon: HomeIcon, iconActive: HomeIconActive },
{ name: 'workbench', label: '工作台', icon: WorkbenchIcon, iconActive: WorkbenchIconActive },
{ name: 'alarm', label: '报警', icon: AlarmIcon, iconActive: AlarmIconActive },
{ name: 'mine', label: '我的', icon: MineIcon, iconActive: MineIconActive },
];
<view v-for="tab in tabs" :key="tab.name" class="action"
@click="NavChange(tab)">
<view class="cuIcon-cu-image">
<image :src="currentTab === tab ? tab.iconActive : tab.icon" ></image>
<image :src="HomeIcon" ></image>
</view>
<view :class="currentTab === tab ? 'text-green' : 'text-gray'">
{{ tab.label }}
</view>
</view>
在H5上没问题, 连接到模拟器上图标就不显示了!!!
1 个回复
p***@163.com
把图片改成英文或者拼音试一试。项目中尽量不要出现中文命令的文件夹或文件