小程序回车提交

表单:

<form bindsubmit="searchSubmit">
<input placeholder="会发言是乖宝宝" name="content" bindchange="" class="input" bindconfirm="searchSubmit" />
</form>

重点在于:bindsubmit=”searchSubmit” 和 bindconfirm=”searchSubmit”

JS:

searchSubmit: function (e) {
    console.log('form发生了submit事件,携带数据为:', e.detail.value)
}