<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title></title> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> <!-- 1. 引入路由脚本,路由的脚本要放在vue脚本的后面 --> <script src="https://unpkg.com/vue-router@2.0.0/dist/vue-router.js"></script> <script src="https://unpkg.com/axios/dist/axios.min.js"></script> </head> <body> <template id="login"> <div> 登录组件 </div> </template> <script> const login = { template: "#login" } </script> <template id="register"> <div> 注册组件 </div> </template> <script> const register = { template: "#register" } </script>