turbo-web 4.2.7 → 4.2.8
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 +5 -4
- package/dist/turbo.js +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,10 +47,10 @@ CDN Version control ( version 1x.2x.3x):
|
|
|
47
47
|
---
|
|
48
48
|
|
|
49
49
|
### [1] IMPORT
|
|
50
|
-
1. (2.) NPM
|
|
50
|
+
1. (2.) NPM installation & NODE script: Import from packages:
|
|
51
51
|
> import { createApp, defineComponent, h, hFragment } from 'turbo-web'
|
|
52
52
|
|
|
53
|
-
3. (4.) Locally
|
|
53
|
+
3. (4.) Locally & CDN: You must use relative paths (./ or ../):
|
|
54
54
|
> import { createApp, defineComponent, h, hFragment } from './framework/runtime/index.js'
|
|
55
55
|
|
|
56
56
|
### [2] LAUNCH
|
|
@@ -95,7 +95,8 @@ Single Source of Truth principle: App's state is persistent between sessions.
|
|
|
95
95
|
|
|
96
96
|
### Feature X: Node-based Initialization through CLI
|
|
97
97
|
Scaffolding setup script that creates base structure with required templates for the App.
|
|
98
|
-
|
|
98
|
+
|
|
99
|
+
Script: ```npx turbo-web ${PROJECT_NAME}``` creates "Project" & src directory + main.js, router.js, store.js + package.json
|
|
99
100
|
|
|
100
101
|
[//]: # (Best practices and guidelines for building applications with the framework.)
|
|
101
102
|
## V. BEST PRACTICES
|
|
@@ -103,7 +104,7 @@ Scaffolding setup script that creates base structure with required templates for
|
|
|
103
104
|
---
|
|
104
105
|
|
|
105
106
|
### Routing
|
|
106
|
-
|
|
107
|
+
|
|
107
108
|
|
|
108
109
|
```const routes = [{ path: '/', component: Home }, {}, {}]```
|
|
109
110
|
```const router = new HashRouter(routes)```
|
package/dist/turbo.js
CHANGED
|
@@ -1050,6 +1050,9 @@ function defineComponent({ render, state, ...methods }) {
|
|
|
1050
1050
|
get appContext() {
|
|
1051
1051
|
return this.#appContext
|
|
1052
1052
|
}
|
|
1053
|
+
get $http() {
|
|
1054
|
+
return this.appContext?.http;
|
|
1055
|
+
}
|
|
1053
1056
|
get elements() {
|
|
1054
1057
|
if (this.#vdom == null) {
|
|
1055
1058
|
return []
|
|
@@ -1172,10 +1175,11 @@ const RouterLink = defineComponent({
|
|
|
1172
1175
|
const RouterOutlet = defineComponent({
|
|
1173
1176
|
state() {
|
|
1174
1177
|
return {
|
|
1175
|
-
matchedRoute:
|
|
1178
|
+
matchedRoute: null,
|
|
1176
1179
|
}
|
|
1177
1180
|
},
|
|
1178
1181
|
onMounted() {
|
|
1182
|
+
this.updateState({ matchedRoute: this.appContext.router.matchedRoute });
|
|
1179
1183
|
this.boundHandler = this.handleRouteChange.bind(this);
|
|
1180
1184
|
this.appContext.router.subscribe(this.boundHandler);
|
|
1181
1185
|
},
|