mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
fix: 枚举字典插件readonly处理
This commit is contained in:
parent
7f9149d26c
commit
8912fa409d
@ -25,13 +25,15 @@ function get(name, key, opt = { dir: 'value', extend: []}) {
|
|||||||
key = ''
|
key = ''
|
||||||
}
|
}
|
||||||
let list = ENUMS[name] || []
|
let list = ENUMS[name] || []
|
||||||
|
let value
|
||||||
if (key) {
|
if (key) {
|
||||||
let res = list.filter(item => item.key === key)[0]
|
let res = list.filter(item => item.key === key)[0]
|
||||||
if (!res) return key
|
if (!res) return key
|
||||||
return readonly(parseValueDir(res.value, opt.dir) || key)
|
value = parseValueDir(res.value, opt.dir) || key
|
||||||
} else {
|
} else {
|
||||||
return readonly(format(list, opt.extend))
|
value = format(list, opt.extend)
|
||||||
}
|
}
|
||||||
|
return typeof value === 'object' ? readonly(value) : value
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user