4044关注13021浏览
Textarea bindinput event not work
- 预期表现
I can get bindinput event e.value
- 复现路径
- 提供一个最简复现 Demo
<!--index.wxml-->
<image class='banner' src='/img/banner.jpg'></image>
<view class="container">
<form class='formMain'>
<view class="section txtBody">
<textarea class='txtContainer' placeholder="" bindinput='textInput' value="{{msgData}}" auto-focus style='background-color:white' />
<text class='txtLengthCounter'>{{msgData.length}}/140</text>
</view>
<view class="btn-rea" style='text-align:right;'>
<view wx:if='{{userInfo}}' class='userInfoContaienr'>
<image bindtap="bindViewTap " class="userinfo-avatar " src="{{userInfo.avatarUrl}} " background-size="cover "></image>
<text class="userinfo-nickname ">{{userInfo.nickName}}</text>
</view>
<!-- <button bindtap='postMsg' class='btn btnAction'>发送 | Send</button> -->
<image src='/img/btnSend.png' class='btnSend' bindtap='postMsg'>发送</image>
<!-- <button bindtap='gobackVote' class='btn btnAction'>返回 | Go Bakc</button> -->
</view>
<view class='btn-area' style='text-align:center;'>
<image wx:if="{{previewImgSrc}}" src='{{previewImgSrc}}'></image>
<image class='btnCamara' wx:else src='/img/btnCamara.png' bindtap="takePhoto"></image>
<!-- <button class='btn btnAction'>选择照片 | Check Img</button> -->
</view>
</form>
</view>
//index.js
//获取应用实例
const app = getApp()
Page({
data: {
pickarray: ["文本", "图片"],
pickIndex: '0',
uploadBucket: '',
previewImgSrc: '',
msgData: '',
motto: 'Hello World',
userInfo: {},
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo')
},
//事件处理函数
bindViewTap: function () {
wx.nav
-
至过去的我
2044人对此回答表示赞同
我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>