refactor: env config (#769)

This commit is contained in:
三咲智子 Kevin Deng 2023-01-04 21:26:30 +08:00 committed by GitHub
parent 9d5dc1bc3d
commit f892722220
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 121 additions and 64 deletions

View file

@ -1,7 +1,7 @@
<script setup lang="ts">
import buildInfo from 'virtual:build-info'
import { buildInfo } from 'virtual:build-info'
let showCommit = $ref(false)
let showCommit = $ref(buildInfo.env !== 'release' && buildInfo.env !== 'dev')
const builtTime = useFormattedDateTime(buildInfo.time)
const handleShowCommit = () => {
@ -35,8 +35,8 @@ const handleShowCommit = () => {
>
<template #content>
<div font-mono>
v{{ buildInfo.version }}
<span v-if="showCommit">({{ buildInfo.commit.slice(0, 7) }})</span>
<span>{{ buildInfo.env === 'release' ? `v${buildInfo.version}` : buildInfo.env }}</span>
<span v-if="showCommit"> ({{ buildInfo.commit.slice(0, 7) }})</span>
</div>
</template>
</SettingsItem>