5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 16:51:16 +08:00
wails/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/routing.mdx
2021-12-06 11:05:37 +08:00

27 lines
669 B
Plaintext

# 路由
路由是一种在应用程序中切换视图的流行方式。此页面提供了有关如何执行此操作的一些指导。
## Vue
在 Vue 中推荐的路由方法是[Hash 模式](https://next.router.vuejs.org/guide/essentials/history-mode.html#hash-mode):
```js
import { createRouter, createWebHashHistory } from "vue-router";
const router = createRouter({
history: createWebHashHistory(),
routes: [
//...
],
});
```
## Angular
在 Angular 中推荐的路由方法是[HashLocationStrategy](https://codecraft.tv/courses/angular/routing/routing-strategies/#_hashlocationstrategy):
```ts
RouterModule.forRoot(routes, { useHash: true });
```