S
S
Stanislav2018-02-10 15:56:50
Vue.js
Stanislav, 2018-02-10 15:56:50

How to use plugins without build system in vue.js?

I just started to understand vue.js and I'm trying to include a plugin in my application, for example, this one: https://www.npmjs.com/package/facebook-login-vuejs
The description says:

import FBSignInButton from 'vue-facebook-signin-button'
Vue.use(FBSignInButton)

Apparently this is for use with the build system. How to connect it simply through <script>?
Tried options like
<script src="/js/vue-facebook-signin-button.min.js"></script>
and Vue.use(FBSignInButton)but it doesn't work. I didn't find anything in the manual.
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dima Polos, 2018-02-10
@stan_b

We connected the plugin from the root, the first. Second, it will not work without a build system, since import/export has not yet been implemented normally without a build system. You can take the source, get the layout from the component, transfer it to html, instead of importing and exporting, manually transfer all instance fields to your js file, check all the dependencies of this component, remember the subtleties associated with the data fields of the component and the root instance. In short, rewrite this whole thing from the source for yourself, so that you can connect everything with a file. Or install a build system, bundle everything and connect the final file to the project.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question