0
votes

I'm a beginner with the Vuejs framework and I'm having a problem in using js libraries in my Vue project... I'll be so grateful if anyone could help me

btw I tried adding this in my main.js file and it didn't work

import template from './assets/js/template.js' Object.definePrototype(Vue.prototype, '$template', { value: template })

template.js is my js file

1
would you please show how template.js looks like?choasia
The import method is correct. So something wrong in js file .Sajed
template.js contains the following code: jquery(document).ready(function($) { $(".headroom").headroom({ "tolerance": 20, "offset": 50, "classes": { "initial": "animated", "pinned": "slideDown", "unpinned": "slideUp" } }); });Romy
Please do not add code scripts in comment area. Instead modify the question with the scriptBharathvaj Ganesan

1 Answers

0
votes

in order to use third party libraries or other scripts just add the script tag with the source pointing to the location of the .js to the index.html file.