3、在入口文件main.js中加入:import $ from 'jquery'
到这里即完成jquery的引用。
引入bootstrap:
1、修改webpack.base.conf.js文件:
2、在入口文件main.js中加入:
3、在assets文件目录中拷贝bootstrap各种文件:
到这里bootstrap引用完成,接下来试试bootstrap使用引用成功:
打开components下面的HelloWorld.vue,替换组件模板
<template>
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">{{ msg }}</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Link</a></li>