feat: display app version from package.json in footer
This commit is contained in:
13
src/App.vue
13
src/App.vue
@@ -21,6 +21,7 @@ const installDismissed = ref(false);
|
|||||||
const isCoarsePointer = ref(false);
|
const isCoarsePointer = ref(false);
|
||||||
const isStandalone = ref(false);
|
const isStandalone = ref(false);
|
||||||
const themePreference = ref('system');
|
const themePreference = ref('system');
|
||||||
|
const appVersion = __APP_VERSION__;
|
||||||
let displayModeMedia = null;
|
let displayModeMedia = null;
|
||||||
let prefersColorSchemeMedia = null;
|
let prefersColorSchemeMedia = null;
|
||||||
|
|
||||||
@@ -164,6 +165,10 @@ onUnmounted(() => {
|
|||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<footer class="app-version">
|
||||||
|
v{{ appVersion }}
|
||||||
|
</footer>
|
||||||
|
|
||||||
<!-- Modals Teleport -->
|
<!-- Modals Teleport -->
|
||||||
<Teleport to="body">
|
<Teleport to="body">
|
||||||
<WinModal v-if="store.isGameWon" />
|
<WinModal v-if="store.isGameWon" />
|
||||||
@@ -238,4 +243,12 @@ onUnmounted(() => {
|
|||||||
.fade-leave-to {
|
.fade-leave-to {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.app-version {
|
||||||
|
margin-top: auto;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: var(--text-muted);
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -4,6 +4,9 @@ import { VitePWA } from 'vite-plugin-pwa'
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
define: {
|
||||||
|
'__APP_VERSION__': JSON.stringify(process.env.npm_package_version)
|
||||||
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
VitePWA({
|
VitePWA({
|
||||||
|
|||||||
Reference in New Issue
Block a user