inleft
2022-08-24 38a800ff006e7d90342ceb53ad547a8aaa2bd4d5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<template>
 
    <a-tabs :defaultActiveKey="activeKey" :tabBarStyle="{'display': 'flex','justify-content': 'center'}">
        <a-tab-pane key="1" tab="片刻">
            <videoList v-on="$listeners" :activeKey="activeKey"></videoList>
        </a-tab-pane>
        <a-tab-pane key="2" tab="流影">
            <photoShow :activeKey="activeKey"></photoShow>
        </a-tab-pane>
        <a-tab-pane key="3" tab="谱库">
            <photoShow :activeKey="activeKey"></photoShow>
        </a-tab-pane>
    </a-tabs>
 
</template>
 
<script>
    import videoList from "../mini/box14-video.vue"
    import photoShow from "../mini/box18-photoShow.vue"
 
    export default {
        components: {
            videoList,
            photoShow
        },
        created() {
            this.getActiveKey()
        },
        watch: {
            '$route'(to, from) {
                if ("platform" === to.name) {
                    this.getActiveKey()
                }
            },
        },
        methods: {
            getActiveKey() {
                if (this.$route.query.activeKey == "" || this.$route.query.activeKey == undefined) {
                    this.activeKey = this.defaultActiveKey;
                } else {
                    this.activeKey = this.$route.query.activeKey;
                }
            },
        },
        data() {
            return {
                activeKey: "1",
                defaultActiveKey: "1",
            }
        },
 
    }
</script>
 
<style lang="less">
    .ant-tabs-tab {
        user-select: none;
    }
</style>