vue-cli4生成项目后修改默认主页的内容
原始的默认首页是vue的欢迎界面
接着找到src>views>Home.vue,这个为默认的首页
将其改为
<template><div class="home"></div></template><script>// @ is an alias to /srcexport default {name: "Home",components: {// HelloWorld,},};</script>
再把src>App.vue改为
<template><div id="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>
最后在Home.vue中进行更改,即可完成想要的首页界面。