Closed jods4 closed 1 month ago
Generic cannot be passed across components. It might be a design limitation.
It is better to explicitly specify the parent component that has root generic component as a generic component, rather than passing it via fallthrough attributes.
@KazariEX Indeed, a wrapped (root) generic component cannot be inferred automatically across another component. I also agree that the best approach for this issue is to have the wrapper use some explicit generic instantiation.
My issue here is that if the wrapper is generic -- and the inner component might not be -- there is no fallthrough happening at all, as demonstrated in repro.
This case should be doable, I've managed to do it myself here: https://github.com/vuejs/language-tools/issues/4882#issuecomment-2375092076
Sorry, I misread it. This is indeed a bug.
Vue - Official extension or vue-tsc version
2.1.6
VSCode version
1.93.1
Vue version
5.4.8
TypeScript version
5.6.2
System Info
package.json dependencies
No response
Steps to reproduce
Check out the repro in playground link below.
It seems that all you need to break
fallthroughAttributes
is a generic component as the wrapper.What is expected?
In playground, I expect completion for
:str
, which is a props ofComp2
, that is wrapped byComp1
with fallthrough.What is actually happening?
I don't get completion. Note that all it takes to fix it is to remove the
generic="T"
inComp1
. If the wrapper is not generic, it seems to work.Link to minimal reproduction
https://play.vuejs.org/#eNqNUk1r3DAQ/StTXTaFYNNtC8U4C2kJtD20oQ30Iihee+xVKktCGm0XjP97RjbxZkMSchHz+ebN6A3i0rlsH1EUogy1V44gIEW3kUb1znqCATy2MELrbQ8rLl0tqS+2d+/mhBRZPrkJTApppKmtCQR96OAiQZytvqLWFv5Yr5s3q7fSlPk8kWexQ9g7XRGyB1DO0EV1IcUHKSDnaJk/KBHnggJPaFWX3QZrmP+QGqWouVNp9D8dKWYgRQFTJuUqJvD/+xQjH/H8Pl7vsP73RPw2HFJMimuPAf2eN1tyVPkOaU5f/f6BB7aXZG+bqLn6heQvDFbHxHEu+xxNw7Qf1E1sv02nVqa7CVcHQhPul0pEU+U41UvBd09He271ltFo523sdpdEXm0j4SmONCNfdfnEx4oAXZmOv4O4Czo06FXN7g3wcmiawELZFmBiv0XPYOKooAS5PpXJ+iiTBltl8NpbF8oBqiPE5uwVGllvBm6CcSxn3Cd0ssx7aSMuPSUSyBfp4cu/gkqj9pPBZtCWJr2ync/xx4z+7tGnf2RC77OP2Scx3gEwRi8l
Any additional comments?
No response