cdui-js 1.0.21 → 1.0.22
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/src/location.ts +7 -5
package/package.json
CHANGED
package/src/location.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isBrowser } from './dom';
|
|
2
|
-
import { reactive } from './reactive';
|
|
2
|
+
import { batch, reactive } from './reactive';
|
|
3
3
|
|
|
4
4
|
export interface Location {
|
|
5
5
|
/**
|
|
@@ -98,10 +98,12 @@ export const updateURL = (path: string, search?: string, hash?: string) => {
|
|
|
98
98
|
location.hash = hash || '';
|
|
99
99
|
|
|
100
100
|
if (location.path !== path || location.search !== search) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
batch(() => {
|
|
102
|
+
location.path = path;
|
|
103
|
+
location.paths = path.match(/\/[^/]*/g) || [];
|
|
104
|
+
location.search = search || '';
|
|
105
|
+
location.query = search ? parseQuery(search) : {};
|
|
106
|
+
});
|
|
105
107
|
}
|
|
106
108
|
};
|
|
107
109
|
|