File tree 8 files changed +52
-18
lines changed
8 files changed +52
-18
lines changed Original file line number Diff line number Diff line change 8
8
</ head >
9
9
< body >
10
10
< div id ="app "> </ div >
11
- < script type ="module " src ="/src/main.js "> </ script >
11
+ < script type ="module " src ="/src/main.ts "> </ script >
12
12
</ body >
13
13
</ html >
Original file line number Diff line number Diff line change 6
6
"build" : " vite build"
7
7
},
8
8
"dependencies" : {
9
- "vue" : " ^3.0.0-rc.1"
9
+ "vue" : " ^3.0.0-rc.1" ,
10
+ "vue-router" : " 4.0.12"
10
11
},
11
12
"devDependencies" : {
12
- "vite " : " ^1 .0.0-rc.1" ,
13
- "@vue/compiler-sfc " : " ^3 .0.0-rc.1"
13
+ "@vue/compiler-sfc " : " ^3 .0.0-rc.1" ,
14
+ "vite " : " ^1 .0.0-rc.1"
14
15
}
15
- }
16
+ }
Original file line number Diff line number Diff line change 1
1
<template >
2
- <img alt =" Vue logo" src =" ./assets/logo.png" />
3
- <HelloWorld msg =" Hello Vue 3.0 + Vite" />
2
+ <div >导航栏</div >
3
+ <router-link to =" /" >首页</router-link >
4
+ <router-link to =" /jam" >jam</router-link >
5
+ <hr />
6
+ <router-view />
4
7
</template >
5
8
6
9
<script >
7
- import HelloWorld from ' ./components/HelloWorld.vue'
8
-
9
10
export default {
10
- name: ' App' ,
11
- components: {
12
- HelloWorld
13
- }
11
+ name: ' App'
14
12
}
15
13
</script >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ jam22222~
4
+ </div >
5
+ </template >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import { createApp } from 'vue'
2
+ import App from './App.vue'
3
+ import './index.css'
4
+ import { createWebHashHistory , createRouter } from 'vue-router'
5
+ import Jam from './components/Jam.vue'
6
+ import Jam2 from './components/Jam2.vue'
7
+ const history = createWebHashHistory ( )
8
+ const router = createRouter ( {
9
+ history :history ,
10
+ routes :[
11
+ { path :'/' , component :Jam } ,
12
+ { path :'/jam' , component :Jam2 } ,
13
+ ]
14
+ } )
15
+
16
+ const app = createApp ( App )
17
+ app . use ( router )
18
+ app . mount ( '#app' )
Original file line number Diff line number Diff line change
1
+ declare module '*.vue' {
2
+ import { ComponentOptions } from 'vue'
3
+ const componentOptions : ComponentOptions
4
+ export default componentOptions
5
+ }
Original file line number Diff line number Diff line change 296
296
" @vue/compiler-dom" " 3.2.31"
297
297
" @vue/shared" " 3.2.31"
298
298
299
+ " @vue/devtools-api@^6.0.0-beta.18 " :
300
+ version "6.1.3"
301
+ resolved "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.1.3.tgz#a44c52e8fa6d22f84db3abdcdd0be5135b7dd7cf"
302
+ integrity sha512-79InfO2xHv+WHIrH1bHXQUiQD/wMls9qBk6WVwGCbdwP7/3zINtvqPNMtmSHXsIKjvUAHc8L0ouOj6ZQQRmcXg==
303
+
299
304
" @vue/reactivity-transform@3.2.31 " :
300
305
version "3.2.31"
301
306
resolved "https://registry.npmmirror.com/@vue/reactivity-transform/-/reactivity-transform-3.2.31.tgz#0f5b25c24e70edab2b613d5305c465b50fc00911"
@@ -1839,6 +1844,13 @@ vite@^1.0.0-rc.1:
1839
1844
vue "^3.0.3"
1840
1845
ws "^7.3.1"
1841
1846
1847
+ vue-router@4.0.12 :
1848
+ version "4.0.12"
1849
+ resolved "https://registry.npmmirror.com/vue-router/-/vue-router-4.0.12.tgz#8dc792cddf5bb1abcc3908f9064136de7e13c460"
1850
+ integrity sha512-CPXvfqe+mZLB1kBWssssTiWg4EQERyqJZes7USiqfW9B5N2x+nHlnsM1D3b5CaJ6qgCvMmYJnz+G0iWjNCvXrg==
1851
+ dependencies :
1852
+ " @vue/devtools-api" " ^6.0.0-beta.18"
1853
+
1842
1854
vue@^3.0.0-rc.1, vue@^3.0.3 :
1843
1855
version "3.2.31"
1844
1856
resolved "https://registry.npmmirror.com/vue/-/vue-3.2.31.tgz#e0c49924335e9f188352816788a4cca10f817ce6"
You can’t perform that action at this time.
0 commit comments