vue-routisan icon indicating copy to clipboard operation
vue-routisan copied to clipboard

Names views returns "Component not defined"

Open nfunwigabga opened this issue 2 years ago • 0 comments

Describe the bug When I try to create a named view, I get a console error Uncaught ReferenceError: components is not defined

To Reproduce In routes.js

import HomePage from "pages/HomePage.vue"
import ParentPage from "pages/ParentPage.vue"
import ParentPageFooter from "components/ParentPageFooter.vue"

// Route definition
Route.view('/', HomePage).name('home');

Route.view('/parent', ParentPage, {
    footer: ParentPageFooter
}).name('page.parent');

Then in my layout, I have:

<template>
    <div class="main-page">
        <nav>
            <router-link to="/">Home</router-link> | <router-link :to="{name: page.parent}">Parent Page</router-link>
        </nav>

        <router-view />
    </div>
    <router-view name="footer" />
</template>

Expected behavior The ParentPageFooter component should be rendered when I visit the Parents Page link, and hidden when I go to the HomePage.

Versions:

  • Vue Routisan: ^3.0.0-beta.5
  • Vue Router: ^4.0.0

nfunwigabga avatar Jul 26 '22 17:07 nfunwigabga