commit | author | age
|
9bcb19
|
1 |
<template> |
I |
2 |
<div class="logo"> |
|
3 |
<router-link :to="{name:'Console'}"> |
|
4 |
<LogoSvg alt="logo" /> |
|
5 |
<h1 v-if="showTitle">{{ this.titles }}</h1> |
|
6 |
</router-link> |
|
7 |
</div> |
|
8 |
</template> |
|
9 |
|
|
10 |
<script> |
|
11 |
import LogoSvg from '@/assets/logo.svg?inline' |
|
12 |
import { mixin, mixinDevice } from '@/utils/mixin' |
|
13 |
|
|
14 |
export default { |
|
15 |
name: 'Logo', |
|
16 |
components: { |
|
17 |
LogoSvg |
|
18 |
}, |
|
19 |
mixins: [mixin, mixinDevice], |
|
20 |
data () { |
|
21 |
return { |
|
22 |
titles: '' |
|
23 |
} |
|
24 |
}, |
|
25 |
props: { |
|
26 |
title: { |
|
27 |
type: String, |
|
28 |
default: 'Snowy', |
|
29 |
required: false |
|
30 |
}, |
|
31 |
showTitle: { |
|
32 |
type: Boolean, |
|
33 |
default: true, |
|
34 |
required: false |
|
35 |
} |
|
36 |
}, |
|
37 |
created () { |
|
38 |
if (this.layoutMode === 'topmenu') { |
|
39 |
if (this.title.length > 8) { |
|
40 |
this.titles = this.title.substring(0, 7) + '...' |
|
41 |
} else { |
|
42 |
this.titles = this.title |
|
43 |
} |
|
44 |
} else { |
|
45 |
if (this.title.length > 10) { |
|
46 |
this.titles = this.title.substring(0, 9) + '...' |
|
47 |
} else { |
|
48 |
this.titles = this.title |
|
49 |
} |
|
50 |
} |
|
51 |
} |
|
52 |
} |
|
53 |
</script> |