BoxTitle.vue
912 Bytes
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
<!--
* @Description:
* @Author: huyue
* @Date: 2023-07-06 11:46:13
* @LastEditors: huyue
* @LastEditTime: 2024-01-26 17:16:49
-->
<template>
<div class="text-box" :style="{'font-size': fontSize + 'px', 'text-align': textAlign}">{{ title }}</div>
</template>
<script>
export default {
name: 'BoxTitle',
props: {
title: {
type: String,
default: '标题'
},
fontSize: {
type: Number,
default: 24
},
textAlign: String
},
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.text-box {
font-family: SourceHanSansCN-Bold;
font-weight: 700;
letter-spacing: 0;
background: linear-gradient(to right, #01A4F9, #6DF5F9); /* 从左到右渐变 */
-webkit-background-clip: text; /* Safari/Chrome支持该属性 */
color: transparent; /* 将文本颜色设置为透明 */
padding-top: 5px;
}
</style>