mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-07 07:10:27 +08:00
找不到匹配的域名时可以指定默认域名、指定不匹配时的处理动作
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
Vue.component("values-box", {
|
||||
props: ["values", "size", "maxlength", "name"],
|
||||
props: ["values", "size", "maxlength", "name", "placeholder"],
|
||||
data: function () {
|
||||
let values = this.values;
|
||||
if (values == null) {
|
||||
@@ -32,6 +32,10 @@ Vue.component("values-box", {
|
||||
}, 200);
|
||||
},
|
||||
confirm: function () {
|
||||
if (this.value.length == 0) {
|
||||
return
|
||||
}
|
||||
|
||||
if (this.isUpdating) {
|
||||
Vue.set(this.vValues, this.index, this.value);
|
||||
} else {
|
||||
@@ -50,30 +54,31 @@ Vue.component("values-box", {
|
||||
this.value = "";
|
||||
}
|
||||
},
|
||||
template: '<div>\
|
||||
<div style="margin-bottom: 1em" v-if="vValues.length > 0">\
|
||||
<div class="ui label tiny" v-for="(value, index) in vValues" style="margin-top:0.4em;margin-bottom:0.4em">{{value}}\
|
||||
<input type="hidden" :name="name" :value="value"/>\
|
||||
<a href="" @click.prevent="update(index)" title="修改"><i class="icon pencil small" ></i></a> \
|
||||
<a href="" @click.prevent="remove(index)" title="删除"><i class="icon remove"></i></a> \
|
||||
</div> \
|
||||
</div> \
|
||||
template: `<div>
|
||||
<div style="margin-bottom: 1em" v-if="vValues.length > 0">
|
||||
<div class="ui label tiny" v-for="(value, index) in vValues" style="margin-top:0.4em;margin-bottom:0.4em">{{value}}
|
||||
<input type="hidden" :name="name" :value="value"/>
|
||||
<a href="" @click.prevent="update(index)" title="修改"><i class="icon pencil small" ></i></a>
|
||||
<a href="" @click.prevent="remove(index)" title="删除"><i class="icon remove"></i></a>
|
||||
</div>
|
||||
<div class="ui divider"></div>
|
||||
</div>
|
||||
<!-- 添加|修改 -->\
|
||||
<div v-if="isAdding || isUpdating">\
|
||||
<div class="ui fields inline">\
|
||||
<div class="ui field">\
|
||||
<input type="text" :size="size" :maxlength="maxlength" v-model="value" ref="value" @keyup.enter="confirm()" @keypress.enter.prevent="1"/>\
|
||||
</div> \
|
||||
<div class="ui field">\
|
||||
<button class="ui button small" type="button" @click.prevent="confirm()">确定</button> \
|
||||
</div>\
|
||||
<div class="ui field">\
|
||||
<a href="" @click.prevent="cancel()">取消</a> \
|
||||
</div> \
|
||||
</div> \
|
||||
</div> \
|
||||
<div v-if="!isAdding && !isUpdating">\
|
||||
<button class="ui button small" type="button" @click.prevent="create()">+</button> \
|
||||
</div>\
|
||||
</div>'
|
||||
<div v-if="isAdding || isUpdating">
|
||||
<div class="ui fields inline">
|
||||
<div class="ui field">
|
||||
<input type="text" :size="size" :maxlength="maxlength" :placeholder="placeholder" v-model="value" ref="value" @keyup.enter="confirm()" @keypress.enter.prevent="1"/>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<button class="ui button small" type="button" @click.prevent="confirm()">确定</button>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<a href="" @click.prevent="cancel()">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!isAdding && !isUpdating">
|
||||
<button class="ui button small" type="button" @click.prevent="create()">+</button>
|
||||
</div>
|
||||
</div>`
|
||||
});
|
||||
Reference in New Issue
Block a user