Bootstrap introduced in Vue

Source: Internet
Author: User

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


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.