Answer the question
In order to leave comments, you need to log in
How to connect a third party script to VueJs?
I tried to connect scripts via npm and further import to the script section and directly to the section via src. I also used vue loader, but none of the options work.
this is how my main.js looks like
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import LoadScript from 'vue-plugin-load-script';
Vue.config.productionTip = false
new Vue({
router,
render: h => h(App)
}).$mount('#app')
Vue.use(LoadScript);
Vue.loadScript("/assets/plugins/jquery/jquery.js")
Vue.loadScript("/assets/js/vendor.js")
Vue.loadScript("/assets/js/theme.js")
Vue.loadScript("/assets/plugins/lazysizes/lazysizes.js")
Vue.loadScript("/assets/plugins/parallax/parallax.js")
<script>
import 'jquery'
import 'jquery-parallax.js'
import 'lazysizes'
import './assets/js/theme.js'
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question