Reputation: 93
I'm using laravel 5.4, with webpack and vue. I'm not sure how to add new libraries to use in vue.
For example, I run
npm install --save jquery vue2-select
What do I need to do next? I need to add:
Import Selectize from 'vue2-selectize'
or
Require ('vue2-selectize')
In the
resources / assets / js / app.js
file or
resources / assets / js / bootstrap.js
?
Can someone help me with the correct order to work?
Thank you!
Upvotes: 0
Views: 1274
Reputation: 1304
import
or require
do almost same thing. But import
is more popular.
npm install --save jquery vue2-selectize
You should run this in your root folder and npm
will place those packages in 'node_modules'. Then import
command will look in 'node_modules' and load it to your file.import Selectize from 'vue2-selectize'
in that file where you want to use Selectize.resources / assets / js / app.js
yes, this is where your front-end app start from. In vue documentation you can read more about single file componentsUpvotes: 1