Skip to content

Commit

Permalink
chore: update playground/vite-webapp
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhongxuYang committed Aug 13, 2024
1 parent 3344e0d commit 38dd608
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
25 changes: 10 additions & 15 deletions playground/vite-webapp/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
<script setup lang="ts">
import {computed} from 'vue'
import HelloWorld from './components/HelloWorld.vue'
const versionInfo = computed(() => `Version: ${__VITE_VERSION__}`)
</script>

<template>
<div>
<a href="https://vitejs.dev" target="_blank">
<img src="/vite.svg" class="logo" alt="Vite logo" />
</a>
<br />
<a href="https://github.com/ZhongxuYang/vite-plugin-version-mark" target="_blank">
<img src="/version.svg" class="logo vue" alt="Version Mark logo" />
</a>
<div>
<a href="https://vitejs.dev" target="_blank">
<img src="/vite.svg" class="logo" alt="Vite logo" />
</a>
<br />
<a href="https://github.com/ZhongxuYang/vite-plugin-version-mark" target="_blank">
<img src="/version.svg" class="logo vue" alt="Version Mark logo" />
</a>
</div>
<router-view />
</div>
<HelloWorld :msg="versionInfo" />
</template>

<style scoped>
Expand Down
5 changes: 3 additions & 2 deletions playground/vite-webapp/src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<script setup lang="ts">
defineProps<{ msg: string }>()
import {computed} from 'vue'
const versionInfo = computed(() => `Version: ${__VITE_VERSION__}`)
</script>

<template>
<h1>{{ msg }}</h1>
<h1>{{ versionInfo }}</h1>
</template>

<style scoped>
Expand Down
4 changes: 2 additions & 2 deletions playground/vite-webapp/src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {createRouter, createWebHistory} from 'vue-router'
import {createRouter, createWebHashHistory} from 'vue-router'
import type {RouteRecordRaw} from 'vue-router'

const routes: RouteRecordRaw[] = [
Expand All @@ -15,7 +15,7 @@ const routes: RouteRecordRaw[] = [
]

const router = createRouter({
history: createWebHistory('/'),
history: createWebHashHistory('/'),
routes,
})
export default router
1 change: 1 addition & 0 deletions playground/vite-webapp/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const testPlugin: () => Plugin = () => ({
})
// https://vitejs.dev/config/
export default defineConfig({
base: '/vite-plugin-version-mark',
build: {
sourcemap: true,
},
Expand Down

0 comments on commit 38dd608

Please sign in to comment.