Before the introduction of a few about Vue to introduce third-party plug-ins, I also practiced a lot, did not expect to introduce bootstrap today and made a low-level error.
The introduction of the bootstrap step is also very simple, first need to modify the Webpack.base.conf.js code under the Build folder,
Alias: {
' vue$ ': ' Vue/dist/vue.esm.js ',
' @ ': Resolve (' src '),
' Assets ': path.resolve (__dirname, ' ... /src/assets '),
' jquery ': "Jquery/src/jquery"
}
Add these two lines:
' Assets ': path.resolve (__dirname, ' ... /src/assets '),
' jquery ': "Jquery/src/jquery"
This configuration I was directly Baidu search out, try to use, can use directly, do not ask me the principle, I generally do not study this.
Then import in Main.js below:
Import './assets/bootstrap/js/bootstrap.min.js '
Import './assets/bootstrap/css/bootstrap.min.css '
Here you need to pay attention to your own path, because I like to be neat and easy to find, so bootstrap all put together.
This is the directory of my Files:
I made a low-level error when introducing Bootstrap, CSS and JS files were put in, but ignored the Fonts folder, so I reported the following error.
The last point, even if there is no error, insurance, re-run side more secure. CNPM Run Dev