0👍
Solution: use a component as a wrapper
Check out the tutorial here:
https://vuejsdevelopers.com/2017/05/20/vue-js-safely-jquery-plugin/
0👍
Check the order of js files/script inside your html. It’s possible that the Vue script is executed before jQuery is loaded. Move jQuery-related script tags above Vue script tags. You can also safely check if jQuery is available in your Vue script by checking for existence of window.$
:
if (typeof window.$ === 'function') {
$("#autocomplete").autocomplete({
source: [ "c++", "java", "php", "coldfusion", "javascript", "asp", "ruby" ]
});
}
- [Vuejs]-This.$refs.fullscreen.toggle is not a function error when using Vue full screen package
- [Vuejs]-Dynamic template with dynamic scope compilation
-1👍
I would suggest u not to use Jquery in Vue. Its bad practice. There is a number of vue plugins u can use and even create your own (which is best option IMHO)
https://www.npmjs.com/package/vue2-autocomplete-js
https://github.com/paliari/v-autocomplete
https://vuejsexamples.com/tag/autocomplete/
https://alligator.io/vuejs/vue-autocomplete-component/
- [Vuejs]-VueJS emit not working in after store dispatch
- [Vuejs]-VueJS and dynamic reload ChartJS when screen resize