关于iview:Iview-Select-filterable远程搜索无匹配数据显示异常

6次阅读

共计 641 个字符,预计需要花费 2 分钟才能阅读完成。

拓展 https://blog.csdn.net/weixin_…

说实话,Iview UI 真的挺坑的, 官网文档什么都没说, 当 Iview UI 中 Select 加了 filterable 属性, 在加了 remote 和:remote-method=” 接口搜寻函数 ” 近程搜寻性能之后, 不论接口有没有数据,“无匹配数据“永远在显示。

<!--cityList 不管是否存在数据,"无匹配数据" 总是莫名其妙的显示 --> 
<Select v-model="model11" filterable>
 <Option v-for="item in cityList" :value="item.value" :key="item">
    {{item.label}}
</Option>
</Select>

 无效的解决办法

not-found-text https://iview.github.io/compo…

<!-- 临时没看源码,只能人为操作 not-found-text--> 
<Select v-model="model11" filterable remote  
:not-found-text="cityList.length===0?'':'无匹配数据'"
:remote-method="remoteMethod" :loading="loading"
>
 <Option v-for="item in cityList" :value="item.value" :key="item">
    {{item.label}}
</Option>
</Select>
正文完
 0