效果图
参考:textarea
代码- app.js
//app.js
App({
onLaunch: function () {
console.log('App Launch')
},
onShow: function () {
console.log('App Show')
},
onHide: function () {
console.log('App Hide')
},
globalData: {
hasLogin: false
}
})
- app.json
{
"pages": [
"pages/textarea/textarea"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle": "black"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}
- textarea.js
Page({
data: {
focus: false
},
bindTextAreaBlur: function (e) {
console.log(e.detail.value)
}
})
- textarea.json
{
"navigationBarTitleText": "textarea 组件"
}
- textarea.wxml
- textarea.wxss
textarea {
width: 700rpx;
padding: 25rpx 0;
}
.textarea-wrp {
padding: 0 25rpx;
background-color: #fff;
}