在main.js中,新建了一个vue实例,并使用el:#app链接到index.html中的app,并使用template引入组件<app>和路由相关的内容。也就是说通过main.js我们关联到App.vue组件,见下图。
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<script>
export default{
name: 'App',
}
</script>