1

The router does not load the components inside my view...

this is the structure:

the view: (test works, finMain does not)

 <template>
  <div>
    <finMain></finMain>
    <p>test</p>

  </div>
</template>

<script>


export default {
  name: 'FinView',
  component: {
    finMain: () => import("../components/finance/finMain"),
  }
};
</script>

the router:

export default new Router({
    routes: [
        {
            path: "/financial",
            name: "financial",
            component: () => import("@/views/finView")
        }

    ],
});

if i put component: () => import("../components/finance/finMain") in my router it works... but not if I wrap the component inside the View..

This is the error i get:

Unknown custom element: <finMain> - did you register the component correctly? 
For recursive components, make sure to provide the "name" option.

found in

---> <FinView>
       <VApp>
         <App> at src/App.vue
           <Root>

1 Answer 1

1

I think that it's just misspelling, change component: { to components: {.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.