Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vue] 组件中写name选项有什么作用? #434

Open
haizhilin2013 opened this issue Jun 22, 2019 · 6 comments
Open

[vue] 组件中写name选项有什么作用? #434

haizhilin2013 opened this issue Jun 22, 2019 · 6 comments
Labels
vue vue

Comments

@haizhilin2013
Copy link
Collaborator

[vue] 组件中写name选项有什么作用?

@haizhilin2013 haizhilin2013 added the vue vue label Jun 22, 2019
@wenyejie
Copy link

蜜汁微笑,
如果用过devTool会有详细感受
如果你使用keep-alive, component等内置组件时
如果你使用循环组件时

遇到了bug, 你就会知道为什么了

@maozhuo123
Copy link

项目使用keep-alive时,可搭配组件name进行缓存过滤
DOM做递归组件时需要调用自身name
vue-devtools调试工具里显示的组见名称是由vue中组件name决定的

@censek
Copy link

censek commented Oct 30, 2019

https://www.jb51.net/article/140702.htm

@ThyeeZz
Copy link

ThyeeZz commented Sep 26, 2020

注册全局组件的时候,也需要使用name吧,Vue.component(ComponentA.name,ComponentA)这样

@dyq086
Copy link

dyq086 commented Aug 4, 2021

1、组件keep-alive缓存用name搭配exclude过滤
2、组件递归调用
3、组件安装
4、vue-devtools调试工具name 对应组件名称

@AAA611
Copy link

AAA611 commented Aug 30, 2022

1

配合 keep-alive

2

vue router 也可以使用组件的 name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vue vue
Projects
None yet
Development

No branches or pull requests

7 participants