vaderjs 1.3.3-alpha-30 → 1.3.3-alpha-32
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 +1 -1
- package/runtime/router.js +9 -4
package/package.json
CHANGED
package/runtime/router.js
CHANGED
|
@@ -138,6 +138,10 @@ class VaderRouter{
|
|
|
138
138
|
if (route.path === hash) {
|
|
139
139
|
return true;
|
|
140
140
|
}
|
|
141
|
+
|
|
142
|
+
if(hash === '' && route.path === '/'){
|
|
143
|
+
return true
|
|
144
|
+
}
|
|
141
145
|
|
|
142
146
|
if (route.path.includes('*') || route.path.includes(':')) {
|
|
143
147
|
const routeParts = route.path.split('/');
|
|
@@ -170,13 +174,14 @@ class VaderRouter{
|
|
|
170
174
|
});
|
|
171
175
|
|
|
172
176
|
|
|
173
|
-
if (!route) {
|
|
177
|
+
if (!route) {
|
|
174
178
|
route = this.routes.find((errorRoute) => {
|
|
175
|
-
|
|
179
|
+
console.log(errorRoute)
|
|
180
|
+
if (errorRoute.path.includes('/404')){
|
|
176
181
|
this.error = true;
|
|
177
182
|
return true;
|
|
178
|
-
} else if (!this.error && errorRoute.path
|
|
179
|
-
|
|
183
|
+
} else if (!this.error && errorRoute.path.includes('/404')){
|
|
184
|
+
window.location.hash = this.basePath
|
|
180
185
|
}
|
|
181
186
|
});
|
|
182
187
|
|