@wsxjs/wsx-router 0.0.14 → 0.0.15
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/package.json +4 -4
- package/src/WsxLink.wsx +5 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wsxjs/wsx-router",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "WSX Router - Native History API-based routing for WSX Framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"!**/test"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@wsxjs/wsx-core": "0.0.
|
|
21
|
+
"@wsxjs/wsx-core": "0.0.15"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@typescript-eslint/eslint-plugin": "^8.37.0",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"typescript": "^5.0.0",
|
|
31
31
|
"vite": "^5.4.19",
|
|
32
32
|
"vitest": "^2.1.8",
|
|
33
|
-
"@wsxjs/
|
|
34
|
-
"@wsxjs/
|
|
33
|
+
"@wsxjs/eslint-plugin-wsx": "0.0.15",
|
|
34
|
+
"@wsxjs/wsx-vite-plugin": "0.0.15"
|
|
35
35
|
},
|
|
36
36
|
"keywords": [
|
|
37
37
|
"wsx",
|
package/src/WsxLink.wsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsxImportSource @wsxjs/wsx-core */
|
|
2
|
-
import { WebComponent, autoRegister, createLogger } from "@wsxjs/wsx-core";
|
|
2
|
+
import { WebComponent, autoRegister, createLogger, state } from "@wsxjs/wsx-core";
|
|
3
3
|
|
|
4
4
|
const logger = createLogger("WsxLink");
|
|
5
5
|
|
|
@@ -23,10 +23,10 @@ const logger = createLogger("WsxLink");
|
|
|
23
23
|
export default class WsxLink extends WebComponent {
|
|
24
24
|
static observedAttributes = ["to", "replace", "active-class", "exact"];
|
|
25
25
|
|
|
26
|
-
private to: string = "";
|
|
27
|
-
private replace: boolean = false;
|
|
28
|
-
private activeClass: string = "active";
|
|
29
|
-
private exact: boolean = false;
|
|
26
|
+
@state private to: string = "";
|
|
27
|
+
@state private replace: boolean = false;
|
|
28
|
+
@state private activeClass: string = "active";
|
|
29
|
+
@state private exact: boolean = false;
|
|
30
30
|
|
|
31
31
|
render() {
|
|
32
32
|
return (
|
|
@@ -66,7 +66,6 @@ export default class WsxLink extends WebComponent {
|
|
|
66
66
|
switch (name) {
|
|
67
67
|
case "to":
|
|
68
68
|
this.to = newValue || "";
|
|
69
|
-
this.rerender(); // Re-render to update href in JSX
|
|
70
69
|
this.updateActiveState();
|
|
71
70
|
break;
|
|
72
71
|
case "replace":
|