I am simply trying to import JQuery to use globally in my Vue 3 application, but I am getting the error the window.$ is not a function
.
I have followed this other article: Add Jquery to Vue-Cli 3
I have defined JQuery in my main.js like this:
window.$ = window.jQuery = require('jquery');
JQuery is installed via npm and this works fine. However, whenever I try to use window.$
in any of my components (under the script tag in my .vue files) I get the error that window.$ is not a function
.
How have I managed to mess this up?