自定义组件内无法双向绑定到对象?
<view wx:if="{{contentType === 'order'}}">
<form>
<view class="cu-form-group margin-top">
<view class="title">乡镇街道</view>
<input model:value="{{orderForm.townName}}" placeholder="输入乡镇名称"></input>
</view>
<view class="cu-form-group margin-top">
<view class="title">村或社区</view>
<input model:value="{{orderForm.villageName}}" placeholder="输入村名称或社区"></input>
</view>
<view class="cu-form-group margin-top">
<view class="title">真实姓名</view>
<input model:value="{{orderForm.realName}}" placeholder="输入真实姓名"></input>
</view>
<view class="cu-form-group margin-top">
<view class="title">手机号码</view>
<input model:value="{{orderForm.phone}}" placeholder="输入手机号码"></input>
</view>
</form>
</view>
data: {
contentType: '',
orderForm: {
townName: '',
villageName: '',
realName: '',
phone: ''
},
test2: ''
}
s输入框输入值后, 提交, 用this.data 查看还是默认值
不知道问题出再什么地方!