提交 b781e8e8 authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

fix: tabs组件新增多个

上级 9dfee5ad
...@@ -142,7 +142,7 @@ export default { ...@@ -142,7 +142,7 @@ export default {
}) })
}, },
addTab() { addTab() {
bus.$emit('add-new-tab') bus.$emit('add-new-tab', this.curComponent.id)
}, },
// 跳转设置 // 跳转设置
linkJumpSet() { linkJumpSet() {
......
...@@ -134,10 +134,14 @@ export default { ...@@ -134,10 +134,14 @@ export default {
tabList: [] tabList: []
} }
}, },
computed: {
...mapState([
'curComponent'
])
},
watch: { watch: {
curComponent: { curComponent: {
handler(newVal, oldVla) { handler(newVal, oldVla) {
console.log(newVal)
}, },
deep: true deep: true
} }
...@@ -147,11 +151,6 @@ export default { ...@@ -147,11 +151,6 @@ export default {
this.tabList = this.element.options && this.element.options.tabList this.tabList = this.element.options && this.element.options.tabList
this.activeTabName = this.tabList[0].name this.activeTabName = this.tabList[0].name
}, },
computed: {
...mapState([
'curComponent'
])
},
methods: { methods: {
beforeHandleCommond(item, param) { beforeHandleCommond(item, param) {
return { return {
...@@ -244,7 +243,8 @@ export default { ...@@ -244,7 +243,8 @@ export default {
this.styleChange() this.styleChange()
}, },
addNewTab() { addNewTab(componentId) {
if (!componentId || componentId !== this.element.id) return
const curName = uuid.v1() const curName = uuid.v1()
const tab = { const tab = {
title: 'NewTab', title: 'NewTab',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论