vue-treeselect
vue-treeselect copied to clipboard
回选问题
在我进行默认选中时未找到对应的id就会出现unknown,请问是否有属性将其开启 置空或者修改提示语
应该可以直接在value里删除不存在的那个值吧
在我进行默认选中时未找到对应的id就会出现unknown,请问是否有属性将其开启 置空或者修改提示语
同样遇到这个问题,尚未解决
在我进行默认选中时未找到对应的id就会出现unknown,请问是否有属性将其开启 置空或者修改提示语
我也遇到这个问题 请问有好的方法解决吗?
@riophae please help Is there anything planned to implement into the component?
As a workaround, I did this to fix this issue (extend your implementation to support arrays if you are using the multiple: true
prop);
mounted() {
/** Fix for selecting the default value on mount */
if (this.value) {
this.onFetch(this.value).finally(() => {
const option = this.options.find(
(option) => option.id === this.value
)
this.$refs['treeselect'].forest.nodeMap[this.value].label =
option.label
})
}
},
onFetch(search) {
return axios.get(url, { data: { search }})
.then(({ data }) => {
this.options = data
})
},
Kind regards.
solved here https://github.com/riophae/vue-treeselect/issues/172#issuecomment-842391127 .