ページ遷移時のタイミングで処理をしたいpluginでページ遷移時の処理を書き、nuxt.config.jsで読み込む方法がある。 例. plugins/routerOption.js export default async ({ app,store }) => { app.router.afterEach((to, from) => { let page_name; page_name = to.name; switch(page_name){ case "privacy" : console.log("privacy page"); store.dispatch("changeTestState", true); break; case "agreement" : console.log("agreement page。"); store.dispatch("changeTestSta
![Nuxt.js ページ遷移時の処理|abyt](https://cdn-ak-scissors.b.st-hatena.com/image/square/35a2d8b7fe7f9f35e36f9fa7f36c65de5456ef11/height=288;version=1;width=512/https%3A%2F%2Fassets.st-note.com%2Fproduction%2Fuploads%2Fimages%2F43431472%2Fprofile_efd84ad0f42fe42706fec1c2ef806ece.jpg%3Ffit%3Dbounds%26format%3Djpeg%26quality%3D85%26width%3D330)