This article mainly introduces the function of using the toast message dialog box in the WeChat applet to prompt the user to forget to enter the user name or password. It analyzes in detail the relevant operating skills of the toast component to implement the message prompt function in the form of examples, and comes with source code for readers to download. For reference, friends in need can refer to
This article describes the example of the WeChat applet using the toast message dialog box to prompt the user to forget to enter the user name or password. Share it with everyone for your reference, as follows:
Key code
① index.wxml
② index.js
Page({ data:{ // text:"这是一个页面" toastHidden:true, userName:'', psw:'' }, formBindsubmit:function(e){ if(e.detail.value.userName.length==0||e.detail.value.psw.length==0){ this.setData({ toastHidden:!this.data.toastHidden }) }else{ this.setData({ tip:'', userName:'用户名:'+e.detail.value.userName, psw:'密码:'+e.detail.value.psw }) } }, formReset:function(){ this.setData({ userName:'', psw:'' }) }, toastBindChange:function(){ this.setData({ toastHidden:!this.data.toastHidden }) } })
The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.
Related articles:
How to build a universal data simulation framework for the front end (detailed tutorial)
How to implement flux on knockoutjs
How to implement seamless scrolling components using vue
About the difficulty of JavaScript array operations (detailed tutorial)
How to implement the like function in WeChat mini program
The above is the detailed content of How to use toast message dialog box in WeChat applet. For more information, please follow other related articles on the PHP Chinese website!