Reload particular page when navigated to from within the SPA
I'm using an embedded widget from a 3rd party on a particular page. The site is using Laravel 10, Vue 3, and Inertia 1.
The widget is using an external script, and to save that script being used on every page I've added it to the one page it'll get used on.
My issue is if this page (URL would be /book-a-table) is navigated to any other page within the site, the external script isn't loaded. If on the page and I hit refresh then the script is loaded. My guess is the app is reloaded and the request is fresh with the external script call included. Visiting the page from any other site also loads the script.
At a guess I'd need some watcher of some sort to check for any page navigating to /book-a-table and fire a page reload?
@thetechnician how are you adding that code? could you share code snippet. you said you are using Vue3. i think you should load that plugin inside your onMounted() hook. if your script depends on complete loading of DOM tree. then you should combine that with nextTick(). that way i think your problem wil be solved.