mirror of
https://github.com/gl-inet/glkvm-cloud.git
synced 2026-10-03 20:30:23 +00:00
Optimize js code by use Vue.set and Vue.delete
Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
This commit is contained in:
@@ -250,17 +250,14 @@ export default {
|
||||
}
|
||||
},
|
||||
handleDelCmdEnv(key) {
|
||||
delete this.cmdData.env[key];
|
||||
this.cmdData.env = Object.assign({}, this.cmdData.env);
|
||||
this.$delete(this.cmdData.env, key);
|
||||
},
|
||||
handleAddCmdEnv() {
|
||||
this.cmdData.currentEnv = this.cmdData.currentEnv.trim();
|
||||
if (this.cmdData.currentEnv != '') {
|
||||
let e = this.cmdData.currentEnv.split('=');
|
||||
if (e.length == 2) {
|
||||
this.cmdData.env[e[0]] = e[1];
|
||||
this.cmdData.env = Object.assign({}, this.cmdData.env);
|
||||
}
|
||||
if (e.length == 2)
|
||||
this.$set(this.cmdData.env, [e[0]], e[1]);
|
||||
this.cmdData.currentEnv = '';
|
||||
}
|
||||
},
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user