From c78368dac9581dab534f6d3dd88033152f3d4640 Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Sat, 24 Oct 2020 14:24:18 +0200 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=BA=90=E6=97=B6,=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E8=BE=93=E5=85=A5=E6=BA=90=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/EditSites.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/EditSites.vue b/src/components/EditSites.vue index f4cc760..a3918cb 100644 --- a/src/components/EditSites.vue +++ b/src/components/EditSites.vue @@ -81,6 +81,9 @@ + + + 取消 @@ -109,6 +112,7 @@ export default { dialogType: 'new', dialogVisible: false, siteInfo: { + key: '', name: '', api: '', download: '', @@ -191,6 +195,7 @@ export default { this.dialogType = 'new' this.dialogVisible = true this.siteInfo = { + key: '', name: '', api: '', download: '', @@ -232,7 +237,7 @@ export default { } var randomstring = require('randomstring') var doc = { - key: this.dialogType === 'edit' ? this.siteInfo.key : randomstring.generate(6), + key: this.dialogType === 'edit' ? this.siteInfo.key : this.siteInfo.key ? this.siteInfo.key : randomstring.generate(6), id: this.dialogType === 'edit' ? this.siteInfo.id : this.sites[this.sites.length - 1].id + 1, name: this.siteInfo.name, api: this.siteInfo.api, @@ -245,6 +250,7 @@ export default { if (this.dialogType === 'edit') sites.remove(this.siteInfo.id) sites.add(doc).then(res => { this.siteInfo = { + key: '', name: '', api: '', download: '',