hagerH1.vue
1.19 KB
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
<!--
* @Date: 2024-09-29 10:07:11
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-10-09 15:37:00
* @FilePath: /hager/src/components/common/hagerH1.vue
* @Description: 文件描述
-->
<template>
<div :class="['hagerH1', is_xs ? 'xs' : '']">
<p class="h1">{{ title }}</p>
<p class="sub">{{ sub }}</p>
</div>
</template>
<script>
import mixin from 'common/mixin';
export default {
mixins: [mixin.init],
props: {
title: {
type: String,
default: '标题'
},
sub: {
type: String,
default: '副标题'
},
width: {
type: Number,
default: 0
}
},
watch: {
width (val) {
this.screen_width = val;
}
},
computed: {
is_xs () {
return this.screen_width < 768;
}
},
data () {
return {
// is_xs: false,
screen_width: 0,
}
},
mounted () {
},
methods: {
}
}
</script>
<style lang="less" scoped>
.hagerH1 {
// &.xs {
// padding: 0 1rem;
// }
.h1 {
color: @secondary-color;
font-size: 1.75rem;
font-weight: bold;
}
.sub {
color: @primary-color;
font-size: 1.25rem;
font-weight: bold;
}
}
</style>