Press "Enter" to skip to content

uni-app子级事件不影响父级事件的写法

<view v-for="item in imgList" :key="item.id" :style="{ background: 'url('+ item.url_img +') no-repeat' , backgroundSize:'100% 100%'}" class="imgItem" @click="showImgPre(item.url_img)">
	<button type='primary' class="btnimgdel" @click.native.stop="delindexImg(item.id)">删除</button>
</view>

子元素绑定事件这样写: @click.native.stop

发表评论