uni-app for循环click.stop无法传参
uni-app for循环click.stop无法传参
| 字段 | 值 |
|---|---|
| PC开发环境操作系统 | Windows |
| PC开发环境操作系统版本号 | 20H2 |
| HBuilderX类型 | 正式 |
| HBuilderX版本号 | 3.3.10 |
| 第三方开发者工具版本号 | 1.05.2201240 |
| 基础库版本号 | 2.21.4 |
| 项目创建方式 | HBuilderX |
产品分类:uniapp/小程序/微信
示例代码:
<block v-for="(goods, index) in goodsList" :key="index">
<view
hover-class="goods-hover-class"
:class="[goodsStyleObject, 'u-one-line-three', 'dir-top-nowrap', 'box-grow-0']"
@click.stop="router(goods)"
>
<view class="u-bottom box-grow-1 dir-top-nowrap main-between">
<view v-if="(isDIY && showGoodsName) || isShowGoodsName" :class="[textAlign, 'box-grow-0', 'u-goods-name', 't-omit-two']">
{{ goods.name }}
</view>
<view class="box-grow-1 dir-top-nowrap main-right">
<view class="box-grow-0 u-price-margin dir-left-nowrap cross-center" :class="[!showGoodsPrice && textStyle !== 2 ? 'main-right' : 'main-between', textStyle === 2 ? 'main-center' : '']">
<view v-if="showGoodsPrice || isShowOriginalPrice(goods)" :class="[theme + '-m-text', theme, 'u-goods-price']">
<view v-if="showGoodsPrice" :class="textAlign">{{ goods.price_content }}</view>
<view v-if="isShowOriginalPrice(goods)" :class="[textAlign, 'u-original-price']">¥{{ goods.original_price }}</view>
<view v-if="!isDIY && goods.is_sales === 1 && goods.is_negotiable !== 1" :class="['u-goods-sales']">{{ goods.sales }}</view>
</view>
<view
v-if="isShowCart && goods.goods_stock !== 0 && goods.is_negotiable !== 1 || (isDIY && isShowBuyBtn(goods) && textStyle !== 2)"
:class="['u-cart-btn-icon', 'box-grow-0', 'u-cart-' + buyBtn, theme + '-m-back', theme]"
@click.stop="buyProduct(goods)"
/>
<view v-if="isDIY && isShowBuyBtn(goods) === 0 && textStyle !== 2 && showBuyBtn" class="u-cart-btn-icon" />
</view>
</view>
</view>
</view>
</block>
更多关于uni-app for循环click.stop无法传参的实战教程也可以访问 https://www.itying.com/category-93-b0.html
7 回复
兄弟你解决了没?
HBuilderX版本号: 3.3.10也有这个问题
更多关于uni-app for循环click.stop无法传参的实战教程也可以访问 https://www.itying.com/category-93-b0.html
你少写了一个导致
@click.stop.prevent
不行啊
我测试行
你的Hbuilder是哪个版本?
最新的呀
兄弟,这个问题有解决方案了没?

