@viewfly/router 0.4.1 → 0.5.0
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/bundles/index.esm.js +3 -3
- package/bundles/index.js +2 -2
- package/package.json +3 -3
package/bundles/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, Fragment } from '@viewfly/core/jsx-runtime';
|
|
2
|
-
import { Injectable, inject,
|
|
2
|
+
import { Injectable, inject, createSignal, onUnmounted, provide } from '@viewfly/core';
|
|
3
3
|
import { Subject, Subscription, fromEvent } from '@tanbo/stream';
|
|
4
4
|
|
|
5
5
|
/******************************************************************************
|
|
@@ -237,7 +237,7 @@ function Link(props) {
|
|
|
237
237
|
(navigator.pathname + '/') === navigator.join(props.to, router)) :
|
|
238
238
|
navigator.pathname.startsWith(navigator.join(props.to, router));
|
|
239
239
|
}
|
|
240
|
-
const isActive =
|
|
240
|
+
const isActive = createSignal(getActive());
|
|
241
241
|
const subscription = navigator.onUrlChanged.subscribe(() => {
|
|
242
242
|
isActive.set(getActive());
|
|
243
243
|
});
|
|
@@ -269,7 +269,7 @@ function Link(props) {
|
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
function RouterOutlet(props) {
|
|
272
|
-
const children =
|
|
272
|
+
const children = createSignal(null);
|
|
273
273
|
const router = inject(Router);
|
|
274
274
|
const childRouter = new Router(inject(Navigator), router, '');
|
|
275
275
|
provide({
|
package/bundles/index.js
CHANGED
|
@@ -239,7 +239,7 @@ function Link(props) {
|
|
|
239
239
|
(navigator.pathname + '/') === navigator.join(props.to, router)) :
|
|
240
240
|
navigator.pathname.startsWith(navigator.join(props.to, router));
|
|
241
241
|
}
|
|
242
|
-
const isActive = core.
|
|
242
|
+
const isActive = core.createSignal(getActive());
|
|
243
243
|
const subscription = navigator.onUrlChanged.subscribe(() => {
|
|
244
244
|
isActive.set(getActive());
|
|
245
245
|
});
|
|
@@ -271,7 +271,7 @@ function Link(props) {
|
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
function RouterOutlet(props) {
|
|
274
|
-
const children = core.
|
|
274
|
+
const children = core.createSignal(null);
|
|
275
275
|
const router = core.inject(Router);
|
|
276
276
|
const childRouter = new Router(core.inject(Navigator), router, '');
|
|
277
277
|
core.provide({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viewfly/router",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
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.
|
|
16
|
+
"@viewfly/core": "^0.5.0",
|
|
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": "75a746eb22f41295157d079e8557154d5fa50e01"
|
|
38
38
|
}
|