search

Home  >  Q&A  >  body text

Extraneous non-props property (title) is passed to component but cannot be used

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>

This is the error I am getting in the chrome console of my Vue application. Below is my parent view component. I'm trying to add multiple components to it, such as homepage content and footer.

<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>

Thanks for any help as I can't figure it out. This error is just a warning and does not affect any pages. But it would be nice to leave. cheers.

P粉463418483P粉463418483241 days ago583

reply all(1)I'll reply

  • P粉785522400

    P粉7855224002024-03-26 09:07:41

    You should add inheritAttrs:false to the child component:

    export default{
    inheritAttrs:false
    ...
    }
    
    

    reply
    0
  • Cancelreply