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
| <template>
| <div class="logo">
| <router-link :to="{name:'Console'}">
| <LogoSvg alt="logo" />
| <h1 v-if="showTitle">{{ this.titles }}</h1>
| </router-link>
| </div>
| </template>
|
| <script>
| import LogoSvg from '@/assets/logo.svg?inline'
| import { mixin, mixinDevice } from '@/utils/mixin'
|
| export default {
| name: 'Logo',
| components: {
| LogoSvg
| },
| mixins: [mixin, mixinDevice],
| data () {
| return {
| titles: ''
| }
| },
| props: {
| title: {
| type: String,
| default: 'Snowy',
| required: false
| },
| showTitle: {
| type: Boolean,
| default: true,
| required: false
| }
| },
| created () {
| if (this.layoutMode === 'topmenu') {
| if (this.title.length > 8) {
| this.titles = this.title.substring(0, 7) + '...'
| } else {
| this.titles = this.title
| }
| } else {
| if (this.title.length > 10) {
| this.titles = this.title.substring(0, 9) + '...'
| } else {
| this.titles = this.title
| }
| }
| }
| }
| </script>
|
|