小程序form表单

// index.wxml
<form bindsubmit="onSubmit">
    <input type="text" placeholder="请输入账号" name="username"/>
    <input type="text" placeholder="请输入密码" name="password"/>
    <button form-type="submit" id="regist">注册</button>
    <button form-type="submit" id="login">登录</button>
</form>

// index.js
onSubmit(res){
	console.log(res)
}
posted @ 2021-04-05 20:23  程序员陈师兄cxycsx  阅读(446)  评论(0)    收藏  举报