Structuring Vue Components in Laravel

Asked

Viewed 241 times

0

Hello I’m beginner with Vuejs and I’m trying to implement it in a project Laravel 5.7 my.

I currently own a few Components and I’m about to create some more and I see that it’s kind of messy everything "thrown" there in the component folder and then I tried to create some folders to better organize, but I realized that I can’t give the

import MeuComponente from './minhaPasta/meuComponente.vue' 

inside my components, because he does not find the component, I believe I have not typed anything wrong but he does not find the file.

My question is: I am doing something wrong or I really don’t have how to structure the components of vuejs in folders in Laravel 5.7?

If there is no way, how do I get my components organized when I start to have some 15+? And if I have how to structure, I ask you to help me.

  • You are using Vue-cli??

  • No, I am using what comes by "default" in the Laravel after the installation via NPM INSTALL, I just run the NPM RUN WATCH (Obs: I can normally access my Components that is in the "Components" folder but not if they are for example in the "Components/pathThis")

  • Your briefcase is inside resources/js ???

  • Yes, resource/js/components/minhaPasta

  • Are the two components on the same level? That is, both are within myWhat? If so, tried to access with ./meuComponente.vue?

  • @guastallaigor no, what I am trying to call this in the directory Minhapasta and what I am calling this in the Components, but when I put the following code, it does not work: import MeuComponent from ./minhaPasta/meuComponent.vue

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.