Commit 76149332 authored by 黄卓's avatar 黄卓

过滤字典项,用于只使用部分字典项的场景

parent de70c170
......@@ -45,7 +45,14 @@ export default {
default: true
}, */
defaultable: Boolean, // 是否默认选择第一个
disabled: Boolean
disabled: Boolean,
/**
* 过滤字典项,用于只使用部分字典项的场景
*/
filter: {
type: Function,
default: () => true
}
},
data(){
return {
......@@ -54,7 +61,7 @@ export default {
},
computed:{
dictList(){
return this.getList(this.type)
return this.getList(this.type).filter(this.filter)
},
formattedList(){
let arr = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment