quanyawei
2024-09-06 60e16bd5406c4cbdf61bf20a50e8e1b49a45b2aa
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<template>
<div class="global-footer">
    <div v-if="links.length > 0" class="global-footer__links">
        <a v-for="(i,index) of links" :key="index" class="global-footer__links-item" @click="to(i)">{{i.title}}</a>
        <!--
        <a v-for="(i,index) of items" :key="index" class="global-footer__links-item" @click="to(i)">
            -->
        <!--
    <ng-container *ngTemplateOutlet="i.host"></ng-container>
    
        </a>
        -->
    </div>
    <div class="global-footer__copyright">
        <slot></slot>
        <!--
        <ng-content></ng-content>
        -->
    </div>
</div>
</template>
 
<script lang="tsx">
import {
    Component,
    Prop,
    Vue,
    Emit,
} from 'vue-property-decorator';
import * as _ from 'lodash';
 
@Component({})
export default class GlobalFooter extends Vue {
 
    @Prop({
        type: Array,
        default: () => {
            return [];
        },
    })
    private links!: any[];
 
    private to(item: any) {
        if (!item.href) {
            return;
        }
        if (item.blankTarget) {
            ( window as any ).open(item.href);
            return;
        }
        if (/^https?:\/\//.test(item.href)) {
            ( window as any ).location.href = item.href;
        } else {
            this.$router.push(item.href);
        }
    }
}
</script>
 
<style lang="less">
@import '../../assets/theme/styles/index.less';
 
@global-footer-prefix: ~'.global-footer';
 
@{global-footer-prefix} {
    display: block;
    padding: 0 16px;
    margin: 48px 0 24px;
    text-align: center;
 
    &__links {
        margin-bottom: 8px;
 
        &-item {
            display: inline-block;
            color: @text-color-secondary;
            transition: all 0.3s;
 
            &:not(:last-child) {
                margin-right: 40px;
            }
 
            &:hover {
                color: @text-color;
            }
        }
    }
 
    &__copyright {
        color: @text-color-secondary;
        font-size: @font-size-base;
    }
}
</style>