<view class="action" :class="{ 'add-action': item.isbig == 1 }" @tap="item.catchtap">
<view class="cuIcon-cu-image">
<image :src="'{{item.iconPath}}'" />
<view class="cu-tag badge" v-if="item.isbadge">{{ item.badge }}</view>
</view>
<view class="cu-text" :style="{ color: item.pagePath == route.url ? item.selectedColor : item.color, fontWeight: item.isblod == 1 ? 'bold' : 'normal' }">
{{ item.text }}
</view>
</view>
@tap="item.catchtap"无效
最后实在没办法,使用土方法了。代码无形中多了很多。。
<template v-if="item.catchtap =='scanCode'">
<view class="action" :class="{ 'add-action': item.isbig == 1 }" @tap="scanCode">
<view class="cuIcon-cu-image">
<image :src="'{{item.iconPath}}'" />
<view class="cu-tag badge" v-if="item.isbadge">{{ item.badge }}</view>
</view>
<view class="cu-text" :style="{ color: item.pagePath == route.url ? item.selectedColor : item.color, fontWeight: item.isblod == 1 ? 'bold' : 'normal' }">
{{ item.text }}
</view>
</view>
</template>
<template v-else-if="item.catchtap =='shopIndex'">
<view class="action" :class="{ 'add-action': item.isbig == 1 }" @tap="shopIndex">
<view class="cuIcon-cu-image">
<image :src="'{{item.iconPath}}'" />
<view class="cu-tag badge" v-if="item.isbadge">{{ item.badge }}</view>
</view>
<view class="cu-text" :style="{ color: item.pagePath == route.url ? item.selectedColor : item.color, fontWeight: item.isblod == 1 ? 'bold' : 'normal' }">
{{ item.text }}
</view>
</view>
</template>
1 个回复
番薯 (作者)
需要实现后台动态加载底部导航与事件绑定