美文网首页
自定义小程序弹窗组件

自定义小程序弹窗组件

作者: 洛昭妍 | 来源:发表于2018-12-10 09:39 被阅读0次

描述

小程序弹窗

使用方法

引入组件相关文件

在使用弹窗的页面引入组件

  在app.wxss中全局引入组件样式

@import '/components/toast/toast.wxss

js中相关

data中添加params对象

data: {

params: {

success: 'success',

context: '弹窗',

time: ''

}

}

onLoad中获取组件引用

this.toast = this.selectComponent("#toast")

调用组件显示弹窗的方法

this.toast.showToast()

API

组件截图

github地址:https://github.com/yueqianjmy/small-toast

博客园:https://www.cnblogs.com/yueqian-jmy/p/10026641.html

CSDN:https://mp.csdn.net/postedit/84767406

相关文章

网友评论

      本文标题:自定义小程序弹窗组件

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