Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

multiple js files vuejs

//Use a single app.js with a single parent-component. Then, on each view that uses a VueJS component, write this:
<div id="parent-component">
	<desired-component ref="desiredComponent"></desired-component>
</div>
<script src = "{{asset('/js/app.js')}}" defer></script>

//Where "desired-component" is a VueJS component that you've included in your app.js file on a line like this one:
Vue.component('desired-component', require('./components/DesiredComponent.vue').default);
 
PREVIOUS NEXT
Tagged: #multiple #js #files #vuejs
ADD COMMENT
Topic
Name
9+3 =