Vue路由篇–基础篇
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://unpkg.com/vue-router/dist/vue-router.js"></script>
首先要引入这两个js文件,如果不下载的话 可以直接script引入,建议下载保存到本地引入,这样快些
下面是代码以及注释,注释都是自己理解,比较容易懂
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="../../vue.js"></script>
<script src="../../vue-router.js"></script>
<style>
.active{
font-size: 20px;
color:red
}
</style>
</head>
<body>
<div id="app">
<ul>
<!-