美文网首页
小程序自带小弹窗

小程序自带小弹窗

作者: 赵羽珩 | 来源:发表于2019-10-15 15:30 被阅读0次
<view class="cu-tag bg-red" catchtap="DelImg_1" data-index="{{index}}">
    DelImg_1(e) {
        wx.showModal({
            title: '删除照片',
            content: '确定要删除这张照片吗?',
            cancelText: '取消',
            confirmText: '删除',
            success: res => {
                if (res.confirm) {
                    this.data.imgList_1.splice(e.currentTarget.dataset.index, 1);
                    this.setData({
                        imgList_1: this.data.imgList_1
                    })
                }
            }
        })
    },
image.png
    if (res.data.data.length === 0) { // 数据没有了,显示一个小弹窗
        return wx.showToast({   // return 表示没有其他的 else
            title: '没有更多数据了',
            icon: 'none',
        })
    }
image.png

相关文章

网友评论

      本文标题:小程序自带小弹窗

      本文链接:https://www.haomeiwen.com/subject/aaqbpctx.html