鍍金池/ 問答/HTML/ vue路由為什么我這個什么都顯示不出來?

vue路由為什么我這個什么都顯示不出來?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="vue.js"></script>
    <script src="vue-router.js"></script>
    <style>
    </style>
    <script type="text/javascript">
        window.onload=function(){
            const t1={
                template:"#t1"
            };
            const t2={
                template:"#t2"
            };
            const t3={
                template:"#t3"
            };
            const routes=[
              {path:'/t1',conponent:t1},
              {path:'/t2',conponent:t2},
              {path:'/t3',conponent:t3},
              {path: '/',redirect:'/t1'},
            ]
            var router = new VueRouter({
                routes:routes
            });
            new Vue({
                el:"#app",
                router
            })
        }
    </script>
</head>
<body>
        <template id="t1">
            <div>
                <h1>11111</h1>
            </div>
        </template>
        <template id="t2">
            <div>
                <h1>22222</h1>
            </div>
        </template>
        <template id="t3">
            <div>
                <h1>33333</h1>
            </div>
        </template>
    <div id="app">
      <div>
          <router-link to="t1"></router-link>
          <router-link to="t2"></router-link>
          <router-link to="t3"></router-link>
      </div>
      <router-view></router-view>
    </div>
</body>
</html>
回答
編輯回答
冷溫柔

{path:'/t1',conponent:t1},
是component,你拼錯了

2017年4月2日 09:14