revert history api
This commit is contained in:
parent
b5b8a7c7ef
commit
2ed994fb6d
|
@ -177,10 +177,10 @@ let contentClicking = false;
|
||||||
|
|
||||||
const focusedElement = document.activeElement;
|
const focusedElement = document.activeElement;
|
||||||
function close(ev, opts: { useSendAnimation?: boolean } = {}) {
|
function close(ev, opts: { useSendAnimation?: boolean } = {}) {
|
||||||
removeEventListener("popstate", close);
|
// removeEventListener("popstate", close);
|
||||||
if (props.preferType == "dialog") {
|
// if (props.preferType == "dialog") {
|
||||||
history.forward();
|
// history.forward();
|
||||||
}
|
// }
|
||||||
if (opts.useSendAnimation) {
|
if (opts.useSendAnimation) {
|
||||||
useSendAnime = true;
|
useSendAnime = true;
|
||||||
}
|
}
|
||||||
|
@ -358,10 +358,10 @@ const onOpened = () => {
|
||||||
},
|
},
|
||||||
{ passive: true }
|
{ passive: true }
|
||||||
);
|
);
|
||||||
if (props.preferType == "dialog") {
|
// if (props.preferType == "dialog") {
|
||||||
history.pushState(null, "", location.href);
|
// history.pushState(null, "", location.href);
|
||||||
}
|
// }
|
||||||
addEventListener("popstate", close);
|
// addEventListener("popstate", close);
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -388,10 +388,10 @@ onMounted(() => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
removeEventListener("popstate", close);
|
// removeEventListener("popstate", close);
|
||||||
if (props.preferType == "dialog") {
|
// if (props.preferType == "dialog") {
|
||||||
history.back();
|
// history.back();
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
|
Loading…
Reference in New Issue