<label class="{{(value !== '' || focus) ? 'narrow' : '' }}" > {{ label }}
<input type="text" value="{{ value }}" name="{{ name }}" bindinput="onInput" bindfocus="bindFocus" bindblur="bindBlur"
</view> |
在自定义组件中添加 input 标签无法使用自带 form 方法获取该 input 组件的值
求解

想要form能获取自定义组件里的表单元素的值,可以使用 https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/behaviors.html 里的内置behaviors
麻烦给个相关的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html),我们定位下问题