1 ```
2 根据子元素传过来的index,赋值给data里面的hideing
3
4 methods: {
5 // 被子组件tabs调用的方法
6 fatherMethod(index) {
7 this.hideing = index;
8 },
9
10
11 <Ordering :class="[hideing === 0 ? 'activeclass' : 'errorclass']" :alldata='alldata'></Ordering>
12 <Message :class="[hideing === 1 ? 'activeclass' : 'errorclass']" :alldata='alldata'></Message>
13 <Introduce :class="[hideing === 2 ? 'activeclass' : 'errorclass']" :alldata='alldata'></Introduce>
14
15 <style scoped>
16 .activeclass {
17 display: block;
18 }
19 .errorclass {
20 display: none;
21 }
22 </style>
23
24 根据hideing的数值 判断是否隐藏
25 ```