Commit 4041c13a by ext.wangyuman1

bug修复

1 parent 66c3021b
......@@ -2,12 +2,7 @@
<div>
<!-- 基础素材 -->
<!-- <div class="g-card" style="padding: 10px"> -->
<el-tabs
v-model="activeName"
@tab-click="
(v) => ((activeTab = v.paneName) && opened.includes(v.paneName)) || opened.push(v.paneName)
"
>
<el-tabs v-model="activeName" @tab-click="tabClick">
{{ activeTab }}
<el-tab-pane v-for="(item, index) in list" :key="index" :label="item.label" :name="item.name">
<component v-if="opened.includes(item.name)" :is="item.component"></component>
......@@ -40,9 +35,15 @@ export default {
{ label: '图文', name: 'imageText', component: MimageText },
{ label: '小程序', name: 'applet', component: Mapplet },
],
opened: ['text'],
opened: [activeTab],
}
},
methods: {
tabClick(v) {
activeTab = v.paneName
this.opened.includes(v.paneName) || this.opened.push(v.paneName)
},
},
created() {
this.$store.setBusininessDesc(
`
......@@ -51,7 +52,7 @@ export default {
)
let first = 'text'
activeTab || (this.activeName = activeTab = first)
console.log(54, activeTab)
this.opened.push(activeTab)
},
}
</script>
......
......@@ -2,10 +2,7 @@
<div>
<!-- 基础素材 -->
<!-- <div class="g-card" style="padding: 10px"> -->
<el-tabs
v-model="activeName"
@tab-click="(v) => opened.includes(v.paneName) || opened.push(v.paneName)"
>
<el-tabs v-model="activeName" @tab-click="tabClick">
<el-tab-pane v-for="(item, index) in list" :key="index" :label="item.label" :name="item.name">
<component v-if="opened.includes(item.name)" :is="item.component"></component>
</el-tab-pane>
......@@ -20,7 +17,7 @@ import Marticle from './article'
import Mvideo from './video'
import Mfile from './file'
import Mposter from './poster'
let activeTab = ''
export default {
name: '',
components: {
......@@ -32,7 +29,7 @@ export default {
},
data() {
return {
activeName: 'outChain',
activeName: activeTab,
list: [
{ label: '外链', name: 'outChain', component: OutChain },
{ label: '文章', name: 'article', component: Marticle },
......@@ -40,9 +37,15 @@ export default {
{ label: '文件', name: 'file', component: Mfile },
{ label: '海报', name: 'poster', component: Mposter },
],
opened: ['outChain'],
opened: [activeTab],
}
},
methods: {
tabClick(v) {
activeTab = v.paneName
this.opened.includes(v.paneName) || this.opened.push(v.paneName)
},
},
created() {
this.$store.setBusininessDesc(
`
......@@ -53,6 +56,10 @@ export default {
if (activeName) {
this.activeName = activeName
this.opened = ['poster']
} else {
let first = 'outChain'
activeTab || (this.activeName = activeTab = first)
this.opened.push(activeTab)
}
},
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!