jquery and Bootstrap are introduced into the scaffolding-built Vue project.

Source: Internet
Author: User

Introducing jquery:

1. In cmd input: npm install jquery, enter, wait.

2. Do the following in the Webpack.base.conf.js:

3. Do the following in the Webpack.prod.conf.js:

4. Introduce in the entry file:

Do not know is not a jquery version of the problem, in the reconstruction of the previously written page, by introducing JS in the. vue file in the way to write the JS introduced (the JS file with the jquery plugin), some functional problems

Introduction of Bootstrap

The practice is carried out by reference to the online approach.

Mainly in the configuration file added two configuration files, this two files must be put together

1.bootstrap.config.js file:

Module.exports = {

Default for the style loading
Styleloader:require (' Extract-text-webpack-plugin '). Extract (' Style-loader ', ' css-loader!postcss-loader! Less-loader '),

Scripts: {
' Transition ': true,
' Alert ': true,
' button ': true,
' Carousel ': true,
' Collapse ': true,
' dropdown ': true,
' Modal ': true,
' ToolTip ': true,
' PopOver ': true,
' Scrollspy ': true,
' tab ': true,
' Affix ': true
},
Styles: {
"Mixins": true,

"Normalize": true,
"Print": true,

"Scaffolding": true,
' Type ': true,
"Code": True,
"Grid": true,
"Tables": true,
"Forms": true,
"Buttons": true,

"Component-animations": true,
"Glyphicons": true,
"Dropdowns": true,
"Button-groups": true,
"Input-groups": true,
"Navs": true,
"NavBar": true,
"Breadcrumbs": true,
"Pagination": true,
"Pager": true,
"Labels": true,
"Badges": true,
"Jumbotron": true,
"Thumbnails": true,
"Alerts": true,
"Progress-bars": true,
"Media": true,
"List-group": true,
"Panels": true,
"Wells": true,
"Close": true,

"Modals": true,
"ToolTip": true,
"Popovers": true,
"Carousel": True,

"Utilities": true,
"Responsive-utilities": True
}
};

2.bootstrap.strap.config.less file (It is said to be empty, not tried):

@font-size-base:24px;
@btn-default-color: #444;
@btn-DEFAULT-BG: #eee;

3. The import file is introduced by importing '/path/bootstrap.min.js ';

4.bootstrap styles can be introduced in this way or introduced in index.html;

5. Other plugins can also be imported via import, but some plugins may have problems, the solution itself Google

jquery and Bootstrap are introduced into the scaffolding-built Vue project.

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.