|
@@ -16,11 +16,21 @@ export default {
|
|
|
return {
|
|
|
active: '',
|
|
|
panels: [],
|
|
|
+ panelsByName: {}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
getAllPanel() {
|
|
|
- this.panels = this.$slots.default.filter(item => item.tag && item.tag.indexOf('ElTabPane') > -1)
|
|
|
+ this.panels = this.$slots.default.filter(item => {
|
|
|
+ const isPanel = item.tag && item.tag.indexOf('ElTabPane') > -1
|
|
|
+ const data = {}
|
|
|
+ if (isPanel && item.child) {
|
|
|
+ data[item.child.name] = item.child
|
|
|
+ item.child.$slots = {}
|
|
|
+ console.log(item)
|
|
|
+ }
|
|
|
+ return isPanel
|
|
|
+ })
|
|
|
},
|
|
|
tab(item) {
|
|
|
this.$router.replace({
|
|
@@ -41,6 +51,7 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getAllPanel()
|
|
|
+ console.log(this.panelsByName)
|
|
|
if (this.panels.length) {
|
|
|
this.active = this.$route.query[this.searchKey] || this.panels[0].child?.name
|
|
|
}
|