WeChat applet (17) input component details, Applet input

Source: Internet
Author: User

Applet (17) input component details, Applet input


The input box is frequently used... If the style is used, you can customize a view. There are not many input attributes. You need to test them slowly and try again.

Main attributes:

Wxml

<! -- A style with a higher priority will overwrite the same attributes as the class --> <view class = "inputView" style = "margin-top: 40% "> <input class =" input "type =" number "placeholder =" enter an account "placeholder-style =" color: red "bindinput =" listenerPhoneInput "/> </view> <view class =" inputView "> <input class =" input "password =" true "placeholder =" enter the password" placeholder-style = "color: red "bindinput =" listenerPasswordInput "/> </view> <button style =" margin-left: 15rpx; margin-right: 15rpx; margin-top: 50rpx; border-radius: 40rpx "type =" primary "bindtap =" listenerLogin "> logon </button>

Js

Page ({/*** initialization data */data: {phone: '', password:'',},/*** enter the listening mobile phone number */listenerPhoneInput: function (e) {this. data. phone = e. detail. value;},/*** listen for Password Input */listenerPasswordInput: function (e) {this. data. password = e. detail. value;},/*** listener logon button */listenerLogin: function () {// print the revenue account and password console. log ('mobile phone number: ', this. data. phone); console. log ('password: ', this. data. password) ;}, onLoad: function (options) {// parameters brought about by page navigation during page initialization options}, onReady: function () {// page rendering completed }, onShow: function () {// page display}, onHide: function () {// page hide}, onUnload: function () {// page close }})

Wxss

.input{  padding-left: 10px;  height: 44px;}.inputView{  border: 2px solid red;  border-radius: 40px;  margin-left: 15px;  margin-right: 15px;  margin-top: 15px;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.