|
1 | 1 | import type { Ref } from "vue"
|
2 | 2 | import { isRef, nextTick, unref } from "vue"
|
3 | 3 | import type { ApiRequest, IReturn, TransitionRules } from "@/types"
|
4 |
| -import { ApiResult, appendQueryString, dateFmt, enc, JsonServiceClient, nameOf, omit, setQueryString, toTime } from "@servicestack/client" |
| 4 | +import { ApiResult, appendQueryString, dateFmt, enc, JsonServiceClient, lastLeftPart, nameOf, omit, setQueryString, toTime } from "@servicestack/client" |
5 | 5 | import { assetsPathResolver } from "./config"
|
6 | 6 | import { Sole } from "./config"
|
7 | 7 |
|
@@ -139,9 +139,11 @@ export function parseJson(json?:string|null) {
|
139 | 139 | return typeof json == 'string' ? JSON.parse(json) : null
|
140 | 140 | }
|
141 | 141 |
|
142 |
| -export function pushState(args:Record<string,any>) { |
143 |
| - if (typeof history != 'undefined') { |
144 |
| - const url = setQueryString(location.href, args) |
| 142 | +export function pushState(args:Record<string,any>, clear?:boolean) { |
| 143 | + if (typeof history != 'undefined') { |
| 144 | + const url = clear |
| 145 | + ? setQueryString(location.href, args) |
| 146 | + : appendQueryString(lastLeftPart(location.href,'?'), args) |
145 | 147 | history.pushState({}, '', url)
|
146 | 148 | }
|
147 | 149 | }
|
|
0 commit comments