slot-scope support multiple parameters
See original GitHub issueWhat problem does this feature solve?
slot-scope support multiple parameters in version 2.6.x. It is supported in version 2.5.x. If not supported, our component library(ant-design-vue) has to change some API.
What does the proposed API look like?
like 2.5.x
<template slot="name" slot-scope="text, record, index..."></template>
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
slot-scope support multiple parameters · Issue #722 - GitHub
If we support multiple arguments, I think that vue-eslint-parser needs the following changes. Change to not throw parse errors. Change AST of ...
Read more >Slot scope with multi parameters - vue.js - Stack Overflow
When I tried to use two parameters in vue slot scope, I can't find any example about it. When I use the following...
Read more >Slots - Vue.js
Here, slot-scope declares the received props object as the slotProps variable, and makes it available inside the <template> scope. You can name slotProps ......
Read more >multiple props in slot-scope or v-slot with vue.js causes ...
However, the correct fix is to allow slot-scope to accept multiple arguments.
Read more >The Trick to Understanding Scoped Slots in Vue.js - YouTube
Learn more about my "Advanced Vue Component Design" course:http://advancedvue.comIn these screencast, I walk through how scoped slots work ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m a bit torn on this. I will fix this because it worked in the past and I don’t want to force you to re-design your API, but you really should avoid using this in the future, and possibly migrate away from it when you can.
The disadvantage compared to destructuring is:
It’s impossible to pass multiple parameters like this when using templates via
<slot foo="bar"/>
, and it’s never been explicitly documented with an example - so it will confuse users who don’t know about render functions.Users have to use the arguments in fixed order and cannot omit the ones they don’t need. e.g. if you have a slot that passes in 5 arguments but the user actually only need the last 2 of them, they will have to declare all 5 just to use the last 2.
If you switch back and forth between the two styles of usage it creates more inconsistency.
v-slot:[col.key]=“text, record”, and I really do not need ‘text’, text is in record object. and my editor is complaining