vue ui打开
app.vue
<template><div id="app"><router-view></router-view></div>
</template><script>export default {name: 'app',}
</script><style>
#app {font-family: 'Avenir', Helvetica, Arial, sans-serif;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;text-align: center;color: #2c3e50;margin-top: 60px;
}
</style>
router.js
import Vue from 'vue'
import Router from 'vue-router'
import Login from './components/Login.vue'Vue.use(Router)export default new Router({routes:[{path:'/',redirect:'/login'},{path:'/login',component:Login}]
})
login.vue
<template>
<div>
登录组件
</div>
</template><script>
export default{}
</script><style lang="less" scoped></style>
运行结果
运行结果