vitarx-router 1.0.0-beta.9 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # VitarxRouter
2
2
 
3
- Vitarx前端框架的配套路由器
3
+ Vitarx前端框架的配套路由器,[文档地址](https://router.vitarx.cn)
4
4
  ________________________________________________________________________
5
5
 
6
6
  ## 安装
@@ -9,41 +9,3 @@ ________________________________________________________________________
9
9
  npm install vitarx-router
10
10
  ```
11
11
 
12
- ## 简单示例
13
-
14
- ```ts
15
- // main.ts
16
- import { createRouter } from 'vitarx-router'
17
- import Page1 from './Page/Page1.js'
18
- import App from './App.js'
19
-
20
- createRouter({
21
- mode: 'path', // 路由模式,可选值:hash、path、memory
22
- suffix: '*', // 允许任何后缀,例如 /x.html
23
- routes: [
24
- {
25
- name: 'home', // 命名路由
26
- path: '/',
27
- widget: lazy(() => import('./Pages/home.js')),// 代码分块懒加载
28
- children: [ // 嵌套路由
29
- {
30
- path: '/workbench',
31
- widget: lazy(() => import('./Pages/home/workbench.js')) // 直接使用小部件
32
- }
33
- ]
34
- },
35
- { // 动态路由
36
- path: '/page1/{name?}',// {name?}为可选参数,没有?为必填参数
37
- widget: Page1
38
- },
39
- { // 命名视图
40
- path: '/page3',
41
- widget: { // 命名视图
42
- 'default': lazy(() => import('./Page/xxx.js')),
43
- 'right': lazy(() => import('./Page/xxx.js'))
44
- }
45
- }
46
- ]
47
- })
48
- createApp('#root').render(App)
49
- ```