devil
December 17, 2018, 8:52am
1
I use jquery in vue of framework7, but there has several problem. My code as follow :
that.$('.js-signature').jqSignature();
the error message is :
vue.esm.js:591 [Vue warn]: Error in created hook: "TypeError: that.$ is not a function"
please help me.
Apparently it says what it is. that.$
is not defined. Probably you haven’t installed it correctly
devil
January 21, 2019, 2:16am
3
Hi Vladimir, thank u for ur reply. You said I had not installed it correctly. But u did not tell my how to install it correctly. I use following command to install :
"npm i jquery --save-dev "
I will appreciate it if u answer again.
main.js
import {$,jQuery} from 'jquery';
// export for others scripts to use
window.$ = $;
window.jQuery = jQuery;
Read this
1 Like
devil
January 21, 2019, 6:55am
5
Hi Aleksey, Thank u for ur reply. The follow code is ok.
new webpack.ProvidePlugin({
$ : "jquery",
jQuery : "jquery"
})
2 Likes