I'm using a NuxtJS pages setup similar to this:
./pages/about.vue
./pages/phones/index.vue
./pages/phones/details.vue
./pages/phones.vue
Inside the ./pages/phones.vue
-file I'm using a <nuxt-child />
component to render the ./pages/phones/index.vue
and ./pages/phones/details.vue
inside of it. Like so:
File: ./pages/phones.vue
:
<nuxt-child />
Inside the ./pages/phones/details.vue
-page I have a link that needs to open the ./pages/about.vue
in the "parent" <Nuxt />
(the normal NuxtJS router-view) NOT the <nuxt-child />
router view.
This is similar to how old-school iframes can open a URL in their parent by using target="_parent"
attribute.
But the nuxt-link "about" (that links to ./pages/about.vue
-page) is still opening in the nuxt-child (router-view).
I think their should be some kind of target
property on the <nuxt-link>
-component:
<nuxt-link :to="{ name: 'about', target: '_parent' }">About</nuxt-link>
NOTE: The above example doesn't work. I'm looking for something like this.
I've searched the web; but, how do you open a link from within a <nuxt-child />
into the parent <Nuxt />
(router) view?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…