mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-13 03:15:48 +02:00
fix: bug fix
This commit is contained in:
parent
5e89860068
commit
20daf836e9
4 changed files with 55 additions and 15 deletions
|
@ -22,8 +22,27 @@ interface IEdit {
|
|||
generate: boolean
|
||||
}
|
||||
|
||||
function fn(obj: Object, desc: any) {
|
||||
let arr: string[]
|
||||
if (typeof desc === 'string') {
|
||||
arr = desc.split('.')
|
||||
} else {
|
||||
arr = [...desc]
|
||||
}
|
||||
|
||||
while (arr.length) {
|
||||
// @ts-ignore
|
||||
const top = obj[arr.shift()]
|
||||
if (top === undefined) {
|
||||
return null
|
||||
}
|
||||
obj = top
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
function readonly(edit: IEdit, dataSource: any, dataIndex: any) {
|
||||
return h('p', dataSource[dataIndex])
|
||||
return h('p', fn(dataSource, dataIndex))
|
||||
}
|
||||
|
||||
function input(edit: IEdit, dataSource: any, dataIndex: any) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue