Using Vue Router with Plain JavaScript
You don’t need to create a Webpack-enabled Vue.js application to use Vue Router. You can use Vue Router alongside the Vue.js library in a static HTML page. Just like the core Vue.js library, you can also install Vue Router with just a CDN.
<
script
src
=
"https://unpkg.com/vue-router/dist/vue-router.js"
><
/script>
Note: The Vue Router library, as well as all other companion libraries, should be loaded after Vue.js.
index.html
<html>
<head>
<title>
A static Vue.js Application with Vue Router</title>
<!-- Vue.js -->
<script
src=
"https://unpkg.com/vue/dist/vue.js"
></script>
<!-- Vue Router -->
<script
src=
"https://unpkg.com/vue-router/dist/vue-router.js"
></script>
<script
src=
"js/app.js"
></script>
</head>
<body>
<div
id=
"app"
>
<h1>
My App</h1>
...