yinbangzhong
2024-09-12 ff0ae974a1c561eaf2915988dac63cd066af189f
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
<template>
  <div class="banner">
    <div class="banner-inner">
      <a-carousel class="carousel" animation-name="fade">
        <a-carousel-item v-for="item in carouselItem" :key="item.slogan">
          <div :key="item.slogan" class="carousel-item">
            <div class="carousel-title">{{ item.slogan }}</div>
            <div class="carousel-sub-title">{{ item.subSlogan }}</div>
            <img class="carousel-image" :src="item.image" />
          </div>
        </a-carousel-item>
      </a-carousel>
    </div>
  </div>
</template>
 
<script lang="ts" setup>
  import { computed } from 'vue';
  import { useI18n } from 'vue-i18n';
  import bannerImage from '@/assets/images/login-banner.png';
 
  const { t } = useI18n();
  const carouselItem = computed(() => [
    {
      slogan: t('login.banner.slogan1'),
      subSlogan: t('login.banner.subSlogan1'),
      image: bannerImage,
    },
    // {
    //   slogan: t('login.banner.slogan2'),
    //   subSlogan: t('login.banner.subSlogan2'),
    //   image: bannerImage,
    // },
    // {
    //   slogan: t('login.banner.slogan3'),
    //   subSlogan: t('login.banner.subSlogan3'),
    //   image: bannerImage,
    // },
  ]);
</script>
 
<style lang="less" scoped>
  .banner {
    display: flex;
    align-items: center;
    justify-content: center;
 
    &-inner {
      flex: 1;
      height: 100%;
    }
  }
 
  .carousel {
    height: 100%;
 
    &-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 100%;
    }
 
    &-title {
      color: var(--color-fill-1);
      font-weight: 500;
      font-size: 20px;
      line-height: 28px;
    }
 
    &-sub-title {
      margin-top: 8px;
      color: var(--color-text-3);
      font-size: 14px;
      line-height: 22px;
    }
 
    &-image {
      width: 320px;
      margin-top: 30px;
    }
  }
</style>