uniapp点击删除按钮弹出(确定和取消提示)

例如点击改删除按钮 

<view class="delete-icon" @click="detele">
    <image src="../../static/delete.png" mode=""></image>
</view>

为它绑定上uniapp官网自带的方法

detele() {
        uni.showModal({
        	title: '提示',
        	content: '你确定要删除吗',
        	success: function (res) {
        		if (res.confirm) {
        			console.log('确定');
        		} else if (res.cancel) {
        			console.log('取消');
        		}
        	}
        });
      }

根据不同选择进行不同的操作就可以了

猜你喜欢

转载自blog.csdn.net/weixin_62639453/article/details/128504366