mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 12:20:28 +08:00
<domain-box>组件自动分割单个域名
This commit is contained in:
@@ -104,9 +104,19 @@ Vue.component("domains-box", {
|
||||
|
||||
if (this.isEditing && this.editingIndex >= 0) {
|
||||
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 {
|
||||
this.domains.push(this.addingDomain)
|
||||
}
|
||||
}
|
||||
this.cancel()
|
||||
this.change()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user