<!--自定义组件-->
<van-field
label="{{ label }}"
>
<slot wx:if="{{ useSlotRightIcon }}" slot="right-icon" name="right-icon"></slot>
<slot wx:if="{{ useSlotButton }}" slot="button" name="button"></slot>
</van-field>
<!--组件使用-->
<base-input
value="{{ value }}"
use-slot-right-icon
>
<image slot="right-icon" src="/img/icon-arrow-on.png"></image>
</base-input>
渲染结果:
您好麻烦提供一下代码片段 https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html