VUE组件中name的作用

福尔摩斯对我笑 2019-04-13 40845 次 4756条

最近在使用VUE的过程中,发现组件中有个name的属性,可写可不写,就比较奇怪,这个属性用来做什么的。经过学习的深入也基本了解了该属性的作用,在此记录下。

递归组件时使用

比如我下面的例子中,list数组里有子项数据,那么就可以直接通过name值调用自身的组件,用来实现递归

使用keep-live包裹组件时,可通过exclude直接设置对某些组件不缓存

这里的Detail就是之前组件的name属性

VUE浏览器插件

使用VUE调式插件时,dom结构中的名称就是name的属性值了

标签:

非特殊说明,本博所有文章均为博主原创。

头像也是LOGO
未来博客 博主大人
到了这个年纪,不应该再彷徨!

发表评论



 


已有 4756 条评论 1


  1. golden goose sneakers

    I have to show my respect for your kindness in support of people who require assistance with that study. Your personal commitment to passing the message across was exceedingly invaluable and has continually helped many people much like me to reach their ambitions. The invaluable help denotes a whole lot to me and especially to my peers. Many thanks; from each one of us.

    回复 2019年10月9日
  2. coach outlet

    I truly wanted to type a brief word so as to appreciate you for some of the lovely ways you are placing on this website. My time-consuming internet look up has now been paid with good strategies to go over with my friends and family. I would suppose that most of us website visitors are unequivocally fortunate to be in a really good community with very many marvellous people with insightful points. I feel very much fortunate to have encountered your entire web pages and look forward to many more enjoyable times reading here. Thank you again for everything.

    回复 2019年10月9日
  3. jordan 12

    I must express my love for your generosity in support of men and women that really want assistance with this particular field. Your real dedication to getting the message along was exceedingly significant and have constantly encouraged folks much like me to get to their dreams. Your personal warm and helpful help and advice can mean so much to me and even further to my colleagues. Thank you; from each one of us.

    回复 2019年10月8日
  4. StevDede

    Cialis 2.5 Mg From Canada viagra Xenical Sans Ordonnance Prix Elocon 5g Elocon Cream

    回复 2019年9月25日
    • best CBD oil for pain

      Your style is very unique compared to other people I have read stuff from.
      I appreciate you for posting when you’ve got the opportunity, Guess I’ll just bookmark this page.

      回复 2020年4月18日
  5. 嘿嘿

    看看

    回复 2019年4月16日