微信小程序 自定义消息提示框
需求描述:
wx.showToast(OBJECT)接口调用,但是不需要icon和image,即便image为空也有占位,实际上只想输出自定义文本内容。
效果截图:
代码如下:
123456 123456 123456 123456 123456 {{text}}
.showModule {
display: flex;
justify-content: center;
align-items: center;
position: fixed;
left: 35%;
top: 40%;
height: 20vh;
width: 30vw;
opacity: 0.99;
background-color: #7b7b7b;
border-radius: 30rpx;
}
.showModule .text {
display: flex;
font-weight: bold;
color: white;
font-size: 13pt;
font-family: "微软雅黑";
}
//index.js
//获取应用实例
var app = getApp()
Page({
data: {
text: "弹窗内容",
isShow: false
},
onShow() {
this.setData({
text: "用户取消支付",
isShow: true
})
}
})
以上就是微信小程序 自定义消息提示框的实例,如有疑问请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!



