BoxTitle.vue 912 Bytes
<!--
 * @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>