真机调试uni-data-select组件时遇到右侧无清除重置图标
按图片标注的红框修改:
代码修改:
<view key="clear-button" v-if="current && clear && !disabled" @click.stop="clearVal">
<uni-icons type="clear" color="#c0c4cc" size="24" />
</view>
<view v-else>
<view key="arrow-button" v-else>
<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" />
</view>
clearVal函数修改:
clearVal() {
this.emit('')
this.current = '' // 添加此行
if (this.collection) {
this.removeCache()
}
}