收藏
回答

请问如何清空input组件中已经输入的内容?

如题

回答关注问题邀请回答
收藏

4 个回答

  • 喀什h建
    喀什h建
    2016-12-16

    为空没用  要设为空数组


    2016-12-16
    有用
    回复
  • 六一
    六一
    2016-12-15
    <view class="main">
      <view class="section">
        <textarea id="idrecord" class="record" maxlength="0" bindchange="bindChange" value="{{record}}" placeholder="聊天记录" auto-height />
      </view>
      <view class="section">
        <form>
          <input id="idsendmsg" class="sendtxt" bindchange="bindChange" value="{{sendmsg}}" placeholder="消息" type="text" auto-focus />
          <view class="btn-area">
            <button form-type="reset" type="primary" bindtap="btnSendMsg">发送消息</button>
          </view>
        </form>
      </view>

    需要清空的加在form里,button设置为form-type="reset"

    2016-12-15
    有用
    回复
  • One




.
    One .
    2016-12-15

    绑定输入事件 返回空

    2016-12-15
    有用
    回复
  • 葛欣.
    葛欣.
    2016-12-15

    <input placeholder="姓名" auto-focus  value="{{name}}"/>


    data: {

        name: ''

      },

      onClearTap: function (e) {

        this.setData({

          name: ''

        })

      },


    2016-12-15
    有用
    回复
登录 后发表内容