Extraneous non-props property (title) is passed to component but cannot be used
P粉463418483
P粉463418483 2024-03-25 20:03:46
0
1
542

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粉463418483
P粉463418483

reply all(1)
P粉785522400

You should add inheritAttrs:false to the child component:

export default{
inheritAttrs:false
...
}

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!