Commit d4dcc0f8 by ext.wangyuman1

bug修复

1 parent 8347d15f
...@@ -4,8 +4,11 @@ ...@@ -4,8 +4,11 @@
<!-- <div class="g-card" style="padding: 10px"> --> <!-- <div class="g-card" style="padding: 10px"> -->
<el-tabs <el-tabs
v-model="activeName" v-model="activeName"
@tab-click="(v) => opened.includes(v.paneName) || opened.push(v.paneName)" @tab-click="
(v) => ((activeTab = v.paneName) && opened.includes(v.paneName)) || opened.push(v.paneName)
"
> >
{{ activeTab }}
<el-tab-pane v-for="(item, index) in list" :key="index" :label="item.label" :name="item.name"> <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> <component v-if="opened.includes(item.name)" :is="item.component"></component>
</el-tab-pane> </el-tab-pane>
...@@ -19,6 +22,7 @@ import Mtext from './text' ...@@ -19,6 +22,7 @@ import Mtext from './text'
import Mimage from './image' import Mimage from './image'
import MimageText from './imageText' import MimageText from './imageText'
import Mapplet from './applet' import Mapplet from './applet'
let activeTab = 'text'
export default { export default {
name: '', name: '',
components: { components: {
...@@ -29,7 +33,7 @@ export default { ...@@ -29,7 +33,7 @@ export default {
}, },
data() { data() {
return { return {
activeName: 'text', activeName: activeTab,
list: [ list: [
{ label: '文本', name: 'text', component: Mtext }, { label: '文本', name: 'text', component: Mtext },
{ label: '图片', name: 'image', component: Mimage }, { label: '图片', name: 'image', component: Mimage },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!