jong-router 0.1.12 → 0.1.13
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 +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ A lightweight and simple-to-use web components router in Vanilla JavaScript with
|
|
|
24
24
|
|
|
25
25
|
- **Route Data**: Include additional data associated with each route. ([Example](https://github.com/josnin/jong-router/tree/main/samples/route-data))
|
|
26
26
|
|
|
27
|
-
- **Router Link**: Use
|
|
27
|
+
- **Router Link**: Use attribute `router-link` to navigate without reloading the page. ([Example](https://github.com/josnin/jong-router/tree/main/samples/router-link))
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
@@ -48,7 +48,7 @@ Include the `jong-router.js` script in your HTML file.
|
|
|
48
48
|
import JongRouter from 'https://cdn.jsdelivr.net/npm/jong-router@latest/dist/jong-router.min.js'
|
|
49
49
|
|
|
50
50
|
// or specific version
|
|
51
|
-
import JongRouter from 'https://cdn.jsdelivr.net/npm/jong-router@0.1.
|
|
51
|
+
import JongRouter from 'https://cdn.jsdelivr.net/npm/jong-router@0.1.13/dist/jong-router.min.js'
|
|
52
52
|
|
|
53
53
|
```
|
|
54
54
|
|
|
@@ -73,9 +73,9 @@ npm i jong-router
|
|
|
73
73
|
|
|
74
74
|
const router = new JongRouter([
|
|
75
75
|
|
|
76
|
-
{
|
|
76
|
+
{ pattern: '/', component: import('./components/HomeComponent') },
|
|
77
77
|
|
|
78
|
-
{
|
|
78
|
+
{ pattern: '/about', component: import('./components/AboutComponent') },
|
|
79
79
|
|
|
80
80
|
// Add more routes as needed
|
|
81
81
|
|
|
@@ -123,7 +123,7 @@ customElements.define('home-component', HomeComponent);
|
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
|
|
126
|
-
Use the
|
|
126
|
+
Use the `router-link` attribute to create navigation links.
|
|
127
127
|
|
|
128
128
|
|
|
129
129
|
|
|
@@ -153,7 +153,7 @@ const router = new JongRouter([
|
|
|
153
153
|
|
|
154
154
|
{
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
pattern: '/dashboard',
|
|
157
157
|
|
|
158
158
|
component: import('./components/DashboardComponent'),
|
|
159
159
|
|
|
@@ -163,7 +163,7 @@ const router = new JongRouter([
|
|
|
163
163
|
|
|
164
164
|
},
|
|
165
165
|
|
|
166
|
-
{
|
|
166
|
+
{ pattern: '/login', component: import('./components/LoginComponent') },
|
|
167
167
|
// ...other routes
|
|
168
168
|
|
|
169
169
|
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jong-router",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "A lightweight and simple-to-use web components router in Vanilla JavaScript with support for guards, nested routes, page not found, passing query parameters to components, passing route parameters to components, passing route data to components, and a router link for single-page application navigation without reloading the page.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jong-router",
|