一、引入第三方CDN资源,网址:http://www.bootcdn.cn/
(1)vue最外层index.html 文件引入资源文件引入如下
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta name="renderer" content="webkit">
<link rel="shortcut icon" href="static/favicon.ico"/>
<title></title>
<link href="https://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="https://cdn.bootcss.com/vue/2.5.2/vue.min.js"></script>
<script src="https://cdn.bootcss.com/vue-router/3.0.1/vue-router.min.js"></script>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
( 2 ) CDN引入vue vue-router 步骤
1. 修改build --> webpack.base.conf.js文件, 修改的地方为:
module.exports = {
entry: {
app: ‘./src/main.js‘
},
externals:{
‘BMap‘: ‘BMap‘,
‘vue‘: ‘Vue‘,
‘vue-router‘: ‘VueRouter‘
},
}
******** 必须使用Vue VueRouter ********
2. main.js 和 router--> index.js 的修改:
// import Vue from ‘vue‘
// import Vue from ‘vue‘
// import VueRouter from ‘vue-router‘
(未完待续)
原文地址:http://blog.51cto.com/13708381/2114367
时间: 2024-10-10 10:24:01