<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content=" width=device-width,user-scalable=no">
<meta content="telephone=no,address=no,email=no" name="format-detection">
<title>vue</title>
<meta name="keywords" content="" />
<meta name="description" content=""/>
<script src="https://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.js"></script>
<script src="https://unpkg.com/vue-router/dist/vue-router.js"></script>
<script type=text/javascript>
(function(win) {
var doc = win.document;
var docEl = doc.documentElement;
var tid;
function refreshRem() {
var width = docEl.getBoundingClientRect().width;
if (width > 750) {
width = 750;
}
var rem = width / 7.5;
docEl.style.fontSize = rem + 'px';
}
win.addEventListener('resize', function() {
clearTimeout(tid);
tid = setTimeout(refreshRem, 300);
}, false);
win.addEventListener('pageshow', function(e) {
if (e.persisted) {
clearTimeout(tid);
tid = setTimeout(refreshRem, 300);
}
}, false);
refreshRem();
})(window);
</script>
</head>
<body>
<div id="app">
<p>{{ message }}</p>
<a @click="move" v-if="isLogin">点击</a>
<router-link to="/home">Go to Foo</router-link>
</div>
<script>
new Vue({
el: '#app',
data: {
message: 'Hello Vue.js!',
isLogin:false
},
methods:{
move(){
console.log('ddd')
}
}
})
</script>
</body>
</html>
类似一个这样的html的页面,如何把vue-router加入进去
还有就是vue的脚手架是vue的精华,建议使用@vue/cli来创建项目