[Vuejs]-Office.JS but in Nuxt

0👍

I have found a solution with the help of a random guy with a heart on the internet that replied to my email (https://github.com/benemohamed). All I did is put following code snippet in my outlook.vue file:

  head() {
    return {
      script: [
        {
          innerHTML: `
        window._historyCache = {
            replaceState: window.history.replaceState,
            pushState: window.history.pushState
        };
     `,
        },
        {
          src: "https://appsforoffice.microsoft.com/lib/1/hosted/office.js",
        },
        {
          innerHTML: `
        // And restore them
        window.history.replaceState = window._historyCache.replaceState;
        window.history.pushState = window._historyCache.pushState;
     `,
        },
      ],
    };
  },

Leave a comment