@viewfly/router 0.5.0 → 0.5.3
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 +27 -26
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -12,6 +12,9 @@ npm install @viewfly/router
|
|
|
12
12
|
## 使用示例
|
|
13
13
|
|
|
14
14
|
```jsx
|
|
15
|
+
import { createApp } from '@viewfly/platform-browser'
|
|
16
|
+
import { RouterModule } from '@viewfly/router'
|
|
17
|
+
|
|
15
18
|
function ListTab1() {
|
|
16
19
|
return () => {
|
|
17
20
|
return (
|
|
@@ -95,37 +98,35 @@ function App() {
|
|
|
95
98
|
return () => {
|
|
96
99
|
return (
|
|
97
100
|
<div>
|
|
98
|
-
<
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
</div>
|
|
122
|
-
</RootRouter>
|
|
101
|
+
<div>
|
|
102
|
+
<Link active="active" exact to="/">Home</Link>
|
|
103
|
+
<Link active="active" to="/list" queryParams={{ a: 'xx' }}>List</Link>
|
|
104
|
+
<Link active="active" to="/detail">Detail</Link>
|
|
105
|
+
</div>
|
|
106
|
+
<div>
|
|
107
|
+
<RouterOutlet config={[
|
|
108
|
+
{
|
|
109
|
+
name: 'home',
|
|
110
|
+
component: Home
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'list',
|
|
114
|
+
asyncComponent: () => Promise.resolve().then(() => List)
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: 'detail',
|
|
118
|
+
component: Detail
|
|
119
|
+
}
|
|
120
|
+
]}>
|
|
121
|
+
未匹配到任何路由
|
|
122
|
+
</RouterOutlet>
|
|
123
|
+
</div>
|
|
123
124
|
</div>
|
|
124
125
|
)
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
|
|
128
|
-
createApp(document.getElementById('app')
|
|
129
|
+
createApp(<App/>)use(new RouterModule()).mount(document.getElementById('app')!)
|
|
129
130
|
```
|
|
130
131
|
|
|
131
132
|
完整文档请参考官方网站:[viewfly.org](https://viewfly.org)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viewfly/router",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "A routing library based on the Viewfly framework that can be run in the browser or Nodejs background.",
|
|
5
5
|
"main": "./bundles/index.js",
|
|
6
6
|
"module": "./bundles/index.esm.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"keywords": [],
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@tanbo/stream": "^1.2.3",
|
|
16
|
-
"@viewfly/core": "^0.5.
|
|
16
|
+
"@viewfly/core": "^0.5.3",
|
|
17
17
|
"url": "^0.11.1"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"bugs": {
|
|
35
35
|
"url": "https://github.com/viewfly/viewfly.git/issues"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "7dadc17107c6fc4b8db6e620e9b95141db09e042"
|
|
38
38
|
}
|