We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
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] 说说你对slot的理解有多少?slot使用场景有哪些?
The text was updated successfully, but these errors were encountered:
slot, 插槽, 在使用组件的时候, 在组建内部插入东西. 组件封装的时候最常使用到
Sorry, something went wrong.
通过插槽可以让用户可以拓展组件,去更好地复用组件和对其做定制化处理
如果父组件在使用到一个复用组件的时候,获取这个组件在不同地方有少量的更改,如果去重写组件是一件不明智的事情
通过slot插槽向组件内部指定位置传递内容,完成这个复用组件在不同场景的应用
比如布局组件、表格列、下拉选、弹框显示内容等 ps:来自https://blog.csdn.net/webblock/article/details/111309987
props作用是让父组件传递给子组件数据,slot作用是让父组件传递给组件内容. slot标签上面可以添加name属性,目的是为了可以有多个插槽 插槽作用域 可以让父组件中访问到子组件中的数据
默认插槽、具名插槽、作用域插槽
No branches or pull requests
[vue] 说说你对slot的理解有多少?slot使用场景有哪些?
The text was updated successfully, but these errors were encountered: