JSFiddle - React, Tailwind, and code Playground

by Pooya Parsa

HTML

<script src="https://unpkg.com/[email protected]/dist/vue-router.js"></script>
 <div id="app">
   <router-view />
 </div>

JavaScript

Vue.use(VueRouter)

const Foo = { template: '<div>foo</div>' }
const Bar = { template: '<div>bar</div>' }

const routes = [
  { 
    path: '/',
    component: {
    	template: '<div>index <router-link to="///google.com">Go to link</router-link> </div>'
    }
  },
  { 
    path: '/*',
    component: {
    	template: '<div>catch all route: {{ $route }}</div>'
    }
  }
]

const router = new VueRouter({
  routes
})

const app = new Vue({
  el: '#app',
  router,
  data: {
    message: 'Hello Vue!',
  },
})