Answer the question
In order to leave comments, you need to log in
How to compile .vue components into separate .js files?
There is, for example, the following file structure:
resources
js
components
ContactForm.vue
OrderForm.vue
<script src="{{ mix('js/vendors.js` }} " ></script> тут VUE
<script src="{{ mix('js/components/ContactForm.js` }} " ></script> компоненты
<script src="{{ mix('js/app.js` }} " ></script> инициализация
Answer the question
In order to leave comments, you need to log in
You can separate the components into folders like so:
resources
js
components
ContactForm
index.js
component.vue
OrderForm.vue
index.js
component.vue
import component from './component.vue'
// регистрирует глобальный компонент
Vue.component('имя компонента', component);
<script src="{{ mix('js/app.js` }}"></script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question