微信小程序----组件之textarea
来源:互联网 发布:mac适用的办公软件 编辑:程序博客网 时间:2024/06/16 10:32
效果图:
项目结构:
核心代码:
index.wxml
<!--textarea.wxml--><view class="section"> <textarea bindblur="bindTextAreaBlur" auto-height placeholder="自动变高" /></view><view class="section"> <textarea placeholder="placeholder颜色是红色的" placeholder-style="color:red;" /></view><view class="section"> <textarea placeholder="这是一个可以自动聚焦的textarea" auto-focus /></view><view class="section"> <textarea placeholder="这个只有在按钮点击的时候才聚焦" focus="{{focus}}" /> <view class="btn-area"> <button bindtap="bindButtonTap">使得输入框获取焦点</button> </view></view><view class="section"> <form bindsubmit="bindFormSubmit"> <textarea placeholder="form 中的 textarea" name="textarea"/> <button form-type="submit"> 提交 </button> </form></view>
index.js//textarea.jsPage({ data: { height: 20, focus: false }, bindButtonTap: function () { this.setData({ focus: true }) }, bindTextAreaBlur: function (e) { console.log(e.detail.value) }, bindFormSubmit: function (e) { console.log(e.detail.value.textarea) }})
源码下载:http://download.csdn.net/download/zhaihaohao1/9968483阅读全文
0 0
- 微信小程序----组件之textarea
- 微信小程序之组件学习
- 微信小程序----组件之view
- 微信小程序----组件之swiper
- 微信小程序----组件之text
- 微信小程序----组件之progress
- 微信小程序----组件之icon
- 微信小程序----组件之button
- 微信小程序----组件之checkbox
- 微信小程序----组件之form
- 微信小程序----组件之input
- 微信小程序----组件之label
- 微信小程序----组件之picker
- 微信小程序----组件之radio
- 微信小程序----组件之slider
- 微信小程序----组件之switch
- 微信小程序之picker组件
- 组件TextArea示例
- sqlserver 判断数据库哪个表记录数据量
- 走穿java设计模式23种-1单例模式详解
- 【计算几何-点的定位】
- 【valid-palindrome】
- 安卓广播监听电量
- 微信小程序----组件之textarea
- 关于python中字典的一些总结
- 【Selenium】14Cookie
- Android_侧滑页面传值Fragment
- jdk
- MPOS银行卡磁条信息加密规范
- mongodb Replica Sets +Sharding高可用集群搭建(含认证)
- 已经为元素 "web-app" 指定属性 "xmlns"
- 面向对象(典型)