赞
踩
- <template>
- <div class="enterprise-audit">
- <div class="card">
- <div class="cardTitle">
- <p>交易查询</p>
- </div>
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="记录" name="first">
- {{1}}
- </el-tab-pane>
- <el-tab-pane label="资" name="second">
- {{2}}
- </el-tab-pane>
- <!-- <el-tab-pane label="金" name="third">
- {{3}}
- </el-tab-pane> -->
- <el-tab-pane label="录" name="fourth">
- {{4}}
- </el-tab-pane>
- <el-tab-pane label="池" name="fifth">
- {{5}}
- </el-tab-pane>
- </el-tabs>
- </div>
- </div>
- </template>
- <script>
-
- export default {
- components: {
-
- },
- props: {
-
- },
- data() {
- return {
- activeName: this.$route.query.activeName || 'first'
- }
- },
- created() {
- this.handleClick()
- },
- methods: {
-
- // tabs 切换
- handleClick(tab, event) {
- this.activeName = tab.name
- }
- }
- }
- </script>
-
- <style lang="scss" scoped>
-
- </style>
点击事件能过获得相应子组件的实例对象
点击事件能够获得事件对象
通过点击事件把tab.name相应的值给展示的activeName这个变量
activeName这个变量也可以根据路由传过来的值进行切换
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。