]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(types/tsx): allow ref_for type on tsx elements
authorEvan You <yyx990803@gmail.com>
Sun, 16 Jan 2022 07:54:58 +0000 (15:54 +0800)
committerEvan You <yyx990803@gmail.com>
Sun, 16 Jan 2022 07:54:58 +0000 (15:54 +0800)
packages/runtime-dom/types/jsx.d.ts
test-dts/defineComponent.test-d.tsx

index e86b67fa3516c89122aa9c798b27cccc88baa143..ab34e299de6bb59653e9566feddb2b1ded2441b4 100644 (file)
@@ -1312,6 +1312,8 @@ type ReservedProps = {
     | string
     | RuntimeCore.Ref
     | ((ref: Element | RuntimeCore.ComponentPublicInstance | null) => void)
+  ref_for?: boolean
+  ref_key?: string
 }
 
 type ElementAttrs<T> = T & ReservedProps
index 49634ef57c058d7c2c595ab7b2d48cd01bcc85a4..c47371ef496a56933dcc70b9c9442619401c315b 100644 (file)
@@ -288,6 +288,7 @@ describe('with object props', () => {
       key={'foo'}
       // should allow ref
       ref={'foo'}
+      ref_for={true}
     />
   )