发布于 2 个月前 作者 hellojiakewei 388 次浏览 来自 问答
粉丝福利 : 关注VUE中文社区公众号,回复视频领取粉丝福利

App.vue <template>

<router-view v-slot="{ Component,route }"> <keep-alive> <component class="view" :is="Component" /> </keep-alive> </router-view>
</template> <style lang="scss"> </style>

Home.vue <template>home</template>

<script lang="ts"> export default { name: "Home", }; </script> <style lang="scss" scoped> </style>

警告信息 runtime-core.esm-bundler.js?5c40:38 [Vue warn]: Extraneous non-props attributes (class) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. at <Home onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > class=“view” > at <KeepAlive> at <RouterView> at <App>

1 回复

找到问题了 不好意思 脑子短路了 ^_^