<template>
    <h1 :class="className">{{ curValue }}</h1>
</template>

<script lang="ts">
import { Environment } from "@/environments/environment";
import { Vue, Component, Prop } from 'vue-property-decorator';

@Component({})
export default class AppPresetTitle extends Vue {
    /**
     * 名称
     *
     * @type {string}
     * @memberof AppPresetTitle
     */
    @Prop() public name!: string;

    /**
     * 类名
     *
     * @memberof AppPresetTitle
     */
    get className(): string {
        return `app-preset-title ${this.name}`;
    }

    /**
     * 当前值
     *
     * @memberof AppPresetTitle
     */
    public curValue: string = '';

    /**
     * 初始化
     *
     * @memberof AppPresetTitle
     */
    public created() {
        this.curValue = Environment.AppTitle;
    }
}
</script>

<style lang='less'>
@import './app-preset-title.less';
</style>