目录
过程演示
首先在项目中导入插件:
- npm install jquery --save
- npm install bootstrap --save
- npm install popper.js --save
程序结构如下:
index.js中添加如下代码
- import '../../node_modules/bootstrap/dist/css/bootstrap.css';
- import '../../node_modules/bootstrap/dist/js/bootstrap.js';
webpack.bas.config.js中添加如下代码:
const webpack = require('webpack')
- module.exports = {
- ....
- ....
- ....,
- plugins: [
- new webpack.ProvidePlugin({
- $: "jquery",
- jQuery: "jquery"
- })
- ]
- }
HellWorld.vue中使用展示:
- <template>
- <div class="hello">
- <h1>{{ msg }}</h1>
- <button class="btn btn-primary" @click="go">点我跳转</button>
- </div>
- </template>
程序运行截图如下: