fix vue router

This commit is contained in:
AceDataCloud committed 2021-08-28 00:24:15 +08:00
1 parent c639af403f
commit 7b98c36a1e
5 files changed
+23 -26

No files matched your search

-17
View File
@@ -1,20 +1,3 @@
<script setup lang="ts">
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
import HelloWorld from './components/HelloWorld.vue';
</script>
<template>
<router-view />
</template>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
+15 -4
View File
@@ -1,7 +1,18 @@
<script setup lang="ts">
<template>
<div>ddd</div>
</template>
<script lang="ts">
export default {
components: {
// LayoutHome
},
data() {
return {};
},
computed: {},
methods: {}
};
</script>
<template>
<h1>{{ msg }}</h1>
</template>
<style lang="scss"></style>
+2 -1
View File
@@ -1,5 +1,6 @@
import { createApp } from 'vue';
import App from './App.vue';
import './style.css';
import router from './router/index';
createApp(App).mount('#app');
createApp(App).use(router).mount('#app');
+2 -1
View File
@@ -1,5 +1,6 @@
import { createRouter, createWebHistory } from 'vue-router';
import Home from '@/component/HelloWorld.vue';
import Home from '@/components/HelloWorld.vue';
const routes = [
{
path: '/',
+4 -3
View File
@@ -11,12 +11,13 @@ export default defineConfig({
}
}
},
plugins: [
vue()
],
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
},
build: {
sourcemap: true
}
});