update 优化 !pr417 解决部分问题 支持vue3版本

This commit is contained in:
疯狂的狮子Li
2023-09-08 17:41:14 +08:00
parent 3b498c4939
commit f2200df15a
2 changed files with 18 additions and 22 deletions

View File

@ -53,13 +53,13 @@ export default {
},
computed: {
values() {
if (this.value === null || typeof this.value !== 'undefined' || this.value === '') return []
if (this.value === null || typeof this.value === 'undefined' || this.value === '') return []
return Array.isArray(this.value) ? this.value.map(item => '' + item) : String(this.value).split(this.separator)
},
unmatch() {
this.unmatchArray = []
// 没有value不显示
if (this.value === null || typeof this.value !== 'undefined' || this.value === '' || this.options.length === 0) return false
if (this.value === null || typeof this.value === 'undefined' || this.value === '' || this.options.length === 0) return false
// 传入值为数组
let unmatch = false // 添加一个标志来判断是否有未匹配项
this.values.forEach(item => {