javascript - Extraneous non-props attributes (title) were passed to component but could not be - Stack Overflow

runtime-core.esm-bundler.js?d2dd:38 [Vue warn]: Extraneous non-props attributes (title) were passed to

runtime-core.esm-bundler.js?d2dd:38 [Vue warn]: Extraneous non-props attributes (title) were passed to ponent but could not be automatically inherited because ponent 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 get in the chrome console of my Vue app. Below is my parent view ponent. I am trying to add multiple ponents to it, e.g home content and footer.

<template>
  <div class="home">
    <ProductTable title="Product List"/>
    <Footer title="I am the child"/>
  </div>
</template>

<script>
import ProductTable from '@/ponents/ProductTable.vue'
import Footer from '@/ponents/Footer.vue'
import Functions from '@/ponents/ProductListFunctions.js'


export default {
  name: 'Home',
  ponents: {
    ProductTable,
    Footer
  }
}
</script>


Any help is appreciated as I cant figure it out. The error is just a warning and doesn't effect any of the page. But it would be nice to be gone. Cheers.

runtime-core.esm-bundler.js?d2dd:38 [Vue warn]: Extraneous non-props attributes (title) were passed to ponent but could not be automatically inherited because ponent 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 get in the chrome console of my Vue app. Below is my parent view ponent. I am trying to add multiple ponents to it, e.g home content and footer.

<template>
  <div class="home">
    <ProductTable title="Product List"/>
    <Footer title="I am the child"/>
  </div>
</template>

<script>
import ProductTable from '@/ponents/ProductTable.vue'
import Footer from '@/ponents/Footer.vue'
import Functions from '@/ponents/ProductListFunctions.js'


export default {
  name: 'Home',
  ponents: {
    ProductTable,
    Footer
  }
}
</script>


Any help is appreciated as I cant figure it out. The error is just a warning and doesn't effect any of the page. But it would be nice to be gone. Cheers.

Share Improve this question asked May 15, 2022 at 9:09 TestnominieeTestnominiee 612 silver badges9 bronze badges 2
  • Please share one of that ponents – Boussadjra Brahim Commented May 15, 2022 at 9:13
  • title is an existing attribute; if you need this as prop, rename it. – user5734311 Commented May 15, 2022 at 9:16
Add a ment  | 

1 Answer 1

Reset to default 5

You should add inheritAttrs:false to the child ponents:

export default{
inheritAttrs:false
...
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744316170a4568193.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信