<template>
  <div id="app">
    <nav>
      <router-link to="/">Home</router-link> |
      <router-link to="/about">About</router-link> |
      <!-- <router-link to="/course">Course</router-link> -->

      <!-- 
        query传参  在地址里面拼接 数据不会丢失
        可以通过path 跳转  也可以通过name跳转
        params传参 页面刷新的时候 数据丢失
        url传参  在router里面定义id接收 然后 在course里面通过params接收参数

      -->
      <router-link :to="{path:'/aa',query:{id: 999,name:'zs'}}">Course</router-link>
      <!-- 
        :to = {
          path: '/course',
          query: {
            id: 999,
            name: 'zs
          }
        }
      -->
      <!-- <router-link :to="{ name: 'Course', query: { id: 888, name: 'lisi' } }"
        >Course</router-link
      > -->

      <!-- <router-link :to="{name: 'Course',params: {name:'zs',id:777}}">Course</router-link> -->
      <!-- <router-link to="/course/5">Course</router-link> -->
    </nav>
    <router-view />
  </div>
</template>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

nav {
  padding: 30px;
}

nav a {
  font-weight: bold;
  color: #2c3e50;
}

nav a.router-link-exact-active {
  color: #42b983;
}
</style>
