修改get.copy,修复一个config只有getter的问题
This commit is contained in:
parent
8588174be6
commit
14cbfdc843
|
@ -1118,21 +1118,11 @@ export class Get extends Uninstantable {
|
|||
* @returns {T}
|
||||
*/
|
||||
static copy(obj) {
|
||||
if (get.objtype(obj) == 'object') {
|
||||
var copy = {};
|
||||
for (var i in obj) {
|
||||
copy[i] = get.copy(obj[i]);
|
||||
}
|
||||
return copy;
|
||||
try {
|
||||
return structuredClone(obj);
|
||||
}
|
||||
else if (Array.isArray(obj)) {
|
||||
var copy = [];
|
||||
for (var i = 0; i < obj.length; i++) {
|
||||
copy.push(get.copy(obj[i]));
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
else {
|
||||
catch {
|
||||
// obj不可序列化时
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4272,15 +4272,27 @@ export class Library extends Uninstantable {
|
|||
get init() {
|
||||
return lib.configMenu.view.config.show_characternamepinyin.init;
|
||||
},
|
||||
set init(newVal) {
|
||||
lib.configMenu.view.config.show_characternamepinyin.init = newVal;
|
||||
},
|
||||
get unfrequent() {
|
||||
return lib.configMenu.view.config.show_characternamepinyin.unfrequent;
|
||||
},
|
||||
set unfrequent(newVal) {
|
||||
lib.configMenu.view.config.show_characternamepinyin.unfrequent = newVal;
|
||||
},
|
||||
get item() {
|
||||
return lib.configMenu.view.config.show_characternamepinyin.item;
|
||||
},
|
||||
set item(newVal) {
|
||||
lib.configMenu.view.config.show_characternamepinyin.item = newVal;
|
||||
},
|
||||
get visualMenu() {
|
||||
return lib.configMenu.view.config.show_characternamepinyin.visualMenu;
|
||||
}
|
||||
},
|
||||
set visualMenu(newVal) {
|
||||
lib.configMenu.view.config.show_characternamepinyin.visualMenu = newVal;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue