mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-12 19:30:26 +08:00
<domain-box>组件自动分割单个域名
This commit is contained in:
@@ -104,9 +104,19 @@ Vue.component("domains-box", {
|
|||||||
|
|
||||||
if (this.isEditing && this.editingIndex >= 0) {
|
if (this.isEditing && this.editingIndex >= 0) {
|
||||||
this.domains[this.editingIndex] = this.addingDomain
|
this.domains[this.editingIndex] = this.addingDomain
|
||||||
|
} else {
|
||||||
|
// 分割逗号(,)、顿号(、)
|
||||||
|
if (this.addingDomain.match("[,、,;]")) {
|
||||||
|
let domainList = this.addingDomain.split(new RegExp("[,、,;]"))
|
||||||
|
domainList.forEach(function (v) {
|
||||||
|
if (v.length > 0) {
|
||||||
|
that.domains.push(v)
|
||||||
|
}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.domains.push(this.addingDomain)
|
this.domains.push(this.addingDomain)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.cancel()
|
this.cancel()
|
||||||
this.change()
|
this.change()
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user