番薯
番薯
  • 发布:2019-07-03 21:34
  • 更新:2019-07-03 21:36
  • 阅读:1943

@tap不支持动态参数吗?

分类:uni-app
tap
<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>
2019-07-03 21:34 负责人:无 分享
已邀请:
番薯

番薯 (作者)


需要实现后台动态加载底部导航与事件绑定

该问题目前已经被锁定, 无法添加新回复