runtime-core.esm-bundler.js?d2dd:38 [Vue warn]: Extraneous non-props attributes (title) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. at <ProductTable title="Product List" > at <Home onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > > at <RouterView> at <App>
這是我在 Vue 應(yīng)用程序的 chrome 控制臺(tái)中遇到的錯(cuò)誤。下面是我的父視圖組件。我正在嘗試向其中添加多個(gè)組件,例如主頁(yè)內(nèi)容和頁(yè)腳。
<template> <div class="home"> <ProductTable title="Product List"/> <Footer title="I am the child"/> </div> </template> <script> import ProductTable from '@/components/ProductTable.vue' import Footer from '@/components/Footer.vue' import Functions from '@/components/ProductListFunctions.js' export default { name: 'Home', components: { ProductTable, Footer } } </script>
感謝任何幫助,因?yàn)槲覠o(wú)法弄清楚。該錯(cuò)誤只是一個(gè)警告,不會(huì)影響任何頁(yè)面。但如果離開(kāi)就好了。干杯。
您應(yīng)該將 inheritAttrs:false
添加到子組件:
export default{ inheritAttrs:false ... }