router_frame.js 444 B

12345678910111213141516
  1. export default {
  2. template: "<div><slot></slot></div>",
  3. mounted() {
  4. window.addEventListener("popstate", (event) => {
  5. if (event.state?.page) {
  6. this.$emit("open", event.state.page);
  7. }
  8. });
  9. const connectInterval = setInterval(async () => {
  10. if (window.socket.id === undefined) return;
  11. this.$emit("open", window.location.pathname);
  12. clearInterval(connectInterval);
  13. }, 10);
  14. },
  15. props: {},
  16. };