input輸入框使用的頻率也是比較高的。 。 。樣式的話自己外麵包裹個view自己定義。 input屬性也不是很多,有需要自己慢慢測,試試
主要屬性:
wxml
<!--style的優(yōu)先級比class高會覆蓋和class相同屬性--> <view class="inputView" style="margin-top: 40% "> <input class="input" type="number" placeholder="請輸入賬號" placeholder-style="color: red" bindinput="listenerPhoneInput" /> </view> <view class="inputView"> <input class="input" password="true" placeholder="請輸入密碼" 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">登錄</button>
js
Page({ /** * 初始化數據 */ data:{ phone: '', password: '', }, /** * 監(jiān)聽手機號輸入 */ listenerPhoneInput: function(e) { this.data.phone = e.detail.value; }, /** * 監(jiān)聽密碼輸入 */ listenerPasswordInput: function(e) { this.data.password = e.detail.value; }, /** * 監(jiān)聽登錄按鈕 */ listenerLogin: function() { //打印收入賬號和密碼 console.log('手機號為: ', this.data.phone); console.log('密碼為: ', this.data.password); }, onLoad:function(options){ // 頁面初始化 options為頁面跳轉所帶來的參數 }, onReady:function(){ // 頁面渲染完成 }, onShow:function(){ // 頁面顯示 }, onHide:function(){ // 頁面隱藏 }, onUnload:function(){ // 頁面關閉 } })
wxss
.input{ padding-left: 10px; height: 44px; } .inputView{ border: 2px solid red; border-radius: 40px; margin-left: 15px; margin-right: 15px; margin-top: 15px; }
js請關注PHP中文網!
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發(fā)現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undress AI Tool
免費脫衣圖片

Undresser.AI Undress
人工智慧驅動的應用程序,用於創(chuàng)建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章
指南:恆星刀片保存文件位置/保存文件丟失/不保存
4 週前
By DDD
Oguri Cap Build Guide |漂亮的德比志
2 週前
By Jack chen
Agnes Tachyon Build Guide |漂亮的德比志
1 週前
By Jack chen
沙丘:覺醒 - 高級行星學家Quest演練
3 週前
By Jack chen
約會一切:德克和哈珀關係指南
4 週前
By Jack chen

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發(fā)環(huán)境

Dreamweaver CS6
視覺化網頁開發(fā)工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)