报错:property "value" of "miniprogram_npm/@vant/weapp/field/index" received type-uncompatible value: expected <String> but get null value. Use empty string instead.
这个是什么问题呢?实在搞不明白。
我是自定义了一个组件wxml:
<van-cell title="{{parmName}}" value="{{showVal}}" bind:click="openPopup"></van-cell>
<van-popup show="{{isShow}}" round custom-style="width: 80%" bind:close="closePopup">
<view style="padding: 20px;">
<view class="title">请输入新的取值</view>
<van-field class="input-box" label="" placeholder="请输入" value="{{inputVal}}" bind:input="onInput"></van-field>
<view class="button-group">
<van-button type="default" bind:click="cancelInput">取消</van-button>
<van-button type="primary" bind:click="confirmInput">确定</van-button>
</view>
</view>
</van-popup>
组件js中,将变量设置为properties,这样就可以接收父组件调用时传递的参数
properties: {
parmName: {
type: String,
value: 'parmName'
},//参数名称
showVal: {
type: String,
value: '0'
},//原先显示的参数值
listIndx: Number, //接收索引
},
在页面中调用该组件,(这边parmName和showVal原本是要传个变量的,我先直接给个数值),然后运行时报错
<userInputbox parmName="速度" showVal="10" listIndx="1"></userInputbox>
请教一下,这是为什么呢,是IDE的问题还是我的语法有问题呢?本人小白刚接触,应该怎么样修改才好呢?