// 指标对象 Vue.component("metric-keys-config-box", { props: ["v-keys"], data: function () { let keys = this.vKeys if (keys == null) { keys = [] } return { keys: keys, isAdding: false, key: "" } }, methods: { cancel: function () { this.key = "" this.isAdding = false }, confirm: function () { if (this.key.length > 0) { this.keys.push(this.key) this.cancel() } }, add: function () { this.isAdding = true let that = this setTimeout(function () { that.$refs.key.focus() }, 100) }, remove: function (index) { this.keys.$remove(index) } }, template: `
` })