clean up
This commit is contained in:
parent
11378b17c5
commit
bdc72e5817
6 changed files with 21 additions and 69 deletions
|
|
@ -60,9 +60,8 @@ const windowRouter = routerFactory(props.initialPath);
|
|||
|
||||
const pageMetadata = ref<null | PageMetadata>(null);
|
||||
const windowEl = shallowRef<InstanceType<typeof MkWindow>>();
|
||||
const history = ref<{ path: string; key: string; }[]>([{
|
||||
const history = ref<{ path: string; }[]>([{
|
||||
path: windowRouter.getCurrentPath(),
|
||||
key: windowRouter.getCurrentKey(),
|
||||
}]);
|
||||
const buttonsLeft = computed(() => {
|
||||
const buttons: Record<string, unknown>[] = [];
|
||||
|
|
@ -100,12 +99,12 @@ function getSearchMarker(path: string) {
|
|||
const searchMarkerId = ref<string | null>(getSearchMarker(props.initialPath));
|
||||
|
||||
windowRouter.addListener('push', ctx => {
|
||||
history.value.push({ path: ctx.path, key: ctx.key });
|
||||
history.value.push({ path: ctx.path });
|
||||
});
|
||||
|
||||
windowRouter.addListener('replace', ctx => {
|
||||
history.value.pop();
|
||||
history.value.push({ path: ctx.path, key: ctx.key });
|
||||
history.value.push({ path: ctx.path });
|
||||
});
|
||||
|
||||
windowRouter.addListener('change', ctx => {
|
||||
|
|
@ -155,7 +154,7 @@ const contextmenu = computed(() => ([{
|
|||
|
||||
function back() {
|
||||
history.value.pop();
|
||||
windowRouter.replace(history.value.at(-1)!.path, history.value.at(-1)!.key);
|
||||
windowRouter.replace(history.value.at(-1)!.path);
|
||||
}
|
||||
|
||||
function reload() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue