ARTICLE DETAIL

资讯详情

深耕网站建设、视觉设计与SEO优化的一线实战洞察。

小程序--loading和toast

小程序--loading和toast

一、loading

        wx.showLoading({})显示loading提示框。wx.hideLoading({})隐藏loading提示框。

                title:文字提示内容

                mask:是否显示透明蒙层,防止触摸穿透。

        更多属性参考showLoading官方文档。

wx.showLoading({title: '加载中...',mask: true
})wx.hideLoading({})

 

二、toast

        wx.showToast({})显示消息提示框(轻提示)。

                icon:是否使用图标,不使用设为none。

                duration:延迟时间。

                mask:是否显示透明蒙层,防止触摸穿透。

        更多属性请参考showToast官方文档。 

        wx.showToast({icon: 'none',title: '查询成功',})

三、注意 

        showLoading和showToast,同时只能显示一个。

返回列表