W
W
WebDev2018-03-28 11:56:49
Vue.js
WebDev, 2018-03-28 11:56:49

How to include the library in vue.js?

It was necessary to integrate a search widget of one company into a project on vue.js. This widget is a js file that needs to be included and then called the init method.
This file does not work without jquery, and I have jquery connected via npm and imported in components that need it via import $ from 'jquery'.
How can I include a widget file? If I connect it via a script in the index.html file, then it swears that jquery is not connected.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2018-03-28
@Sanasol

import $ from 'jquery'

window.$ = window.jQuery = $;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question