<template><div class="home"><Gotop/></div></template><script>// @ is an alias to /srcimport Gotop from"@/components/Gotop.vue";exportdefault{
name:"Home",
components:{
Gotop
}};</script>
封装一下返回顶部吧,这个在实际开发中用到的地方很多,看一下具体实现代码吧父页面引入注册子组件<template> <div class="home"> <Gotop/> </div></template><script>// @ is an alias to /srcimport Gotop from "@/components/Gotop.vue";export default { name: