| | |
| | | }); |
| | | |
| | | var results = this.editableTabs.some(function (item) { |
| | | if (item.name == "张三") { |
| | | if (item.name == key) { |
| | | //item.name == "王麻子" |
| | | return true; //返回false |
| | | } |
| | | }); |
| | | if (!results) { |
| | | this.editableTabs.push(result); |
| | | } |
| | | this.editableTabsValue = key; |
| | | console.log(result); |
| | | }, |
| | | handleTabsEdit(targetName, action) { |
| | | if (action === "add") { |
| | | let newTabName = ++this.tabIndex + ""; |
| | | this.editableTabs.push({ |
| | | title: "New Tab", |
| | | name: newTabName, |
| | | content: "New Tab content", |
| | | }); |
| | | this.editableTabsValue = newTabName; |
| | | } |
| | | if (action === "remove") { |
| | | let tabs = this.editableTabs; |