-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
124 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"time": 1715932697767, | ||
"version": "2024.5.17" | ||
"time": 1716290495760, | ||
"version": "2024.5.21" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,43 @@ | ||
import { createRouter, createWebHashHistory } from "vue-router"; | ||
import { createRouter, createWebHashHistory, type Router } from "vue-router"; | ||
import Home from "./Home.vue"; | ||
import About from "./About.vue"; | ||
import Follow from "./Follow.vue"; | ||
import Fans from "./Fans.vue"; | ||
|
||
const router = createRouter({ | ||
// 4. 内部提供了 history 模式的实现。为了简单起见,我们在这里使用 hash 模式。 | ||
history: createWebHashHistory(), | ||
routes: [ | ||
{ | ||
path: '/', | ||
name: "Home", | ||
component: Home, | ||
meta: { | ||
keepAlive: true | ||
}, | ||
}, | ||
{ | ||
path: "/about", | ||
name: "About", | ||
component: About | ||
}, | ||
{ | ||
path: '/follow', | ||
name: "Follow", | ||
component: Follow | ||
}, | ||
{ | ||
path: '/fans', | ||
name: "Fans", | ||
component: Fans, | ||
}, | ||
], | ||
}) | ||
const TiebaRouter = { | ||
router: null as unknown as Router, | ||
init() { | ||
this.router = createRouter({ | ||
// 4. 内部提供了 history 模式的实现。为了简单起见,我们在这里使用 hash 模式。 | ||
history: createWebHashHistory(), | ||
routes: [ | ||
{ | ||
path: "/", | ||
name: "Home", | ||
component: Home, | ||
meta: { | ||
keepAlive: true, | ||
}, | ||
}, | ||
{ | ||
path: "/about", | ||
name: "About", | ||
component: About, | ||
}, | ||
{ | ||
path: "/follow", | ||
name: "Follow", | ||
component: Follow, | ||
}, | ||
{ | ||
path: "/fans", | ||
name: "Fans", | ||
component: Fans, | ||
}, | ||
], | ||
}); | ||
this.router.push("/"); | ||
}, | ||
}; | ||
|
||
router.push("/"); | ||
|
||
export { | ||
router | ||
} | ||
export { TiebaRouter }; |