微信小程序双向数据绑定
使用vant组件实现
引入
"van-field": "@vant/weapp/field/index"
1. <van-cell-group> 2. <van-field 3. model:value="{{ value }}" 4. placeholder="请输入用户名" 5. border="{{ false }}" 6. /> 7. </van-cell-group> 8. 9. <van-cell-group> 10. <van-field 11. model:value="{{ value }}" 12. placeholder="请输入用户名" 13. border="{{ false }}" 14. /> 15. </van-cell-group>
1. Page({ 2. data: { 3. value: '', 4. }, 5. });