mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
getDataBrage支持多级嵌套取值
This commit is contained in:
@@ -2270,7 +2270,7 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick
|
||||
return defaultValue;
|
||||
},
|
||||
dataBrage: null,
|
||||
getDataBrage(name, defaultValue) {
|
||||
getDataBrage(keys, defaultValue) {
|
||||
if (this.dataBrage == null) {
|
||||
this.dataBrage = JSON.parse($('#data-brage').text());
|
||||
}
|
||||
@@ -2279,11 +2279,12 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick
|
||||
defaultValue = undefined;
|
||||
}
|
||||
|
||||
if (typeof this.dataBrage[name] == 'undefined') {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
return this.dataBrage[name];
|
||||
return (
|
||||
(!Array.isArray(keys)
|
||||
? keys.replace(/\[/g, '.').replace(/\]/g, '').split('.')
|
||||
: keys
|
||||
).reduce((o, k) => (o || {})[k], this.dataBrage) || defaultVal
|
||||
);
|
||||
|
||||
},
|
||||
getExtGroupName(ext) {
|
||||
|
||||
Reference in New Issue
Block a user