Passing parameters to vue-router in iframe of laraval application fails

Viewed 117

I have a strange error on a project of mine. I'm trying to switch a laravel project to something where the backend is seperated from the frontend. Backend api stays laravel, but frontend is vue with quasar.

Since we want to do the change gradualy, i made one new feature in quasar and want to integrate it in my existing laravel-app. In order to accomplish that, i'm using an iframe in which i load the new vue frontend. Everything works as it should work, except for one crucial thing. I have one id-parameter from laravel that should be passed to the iframe (the quasar/vue application), and for some reason... that's not working.

I've tried to work with route parameters

<iframe src='/spa/12'

and in vue-router

 { path: '/:id', component: () => import('pages/weekSchedule.vue') }

Without success

I've tried query parameters in the url like this

<iframe src='/spa/index.html?id=12'

I can see the correct url in my network inspector, the url is called with the query, but i can't seem to get the parameters in vue.

async mounted() {
    this.id=  this.$route.query.id
}

When i test it -not in iframe- everything is working.
But in iframe i get nothing.

Does anybody have an idea/solution? Any help is appreciated!

0 Answers
Related