mirror of
https://github.com/vuejs/vue.git
synced 2024-11-22 04:39:46 +00:00
test: add test case for #12778
This commit is contained in:
parent
f7db7f361b
commit
5aed733ab6
@ -1,4 +1,4 @@
|
||||
import { VNode, defineComponent, ref } from '../../index'
|
||||
import { VNode, defineComponent, ref, RenderContext } from '../../index'
|
||||
import { expectType } from '../utils'
|
||||
|
||||
expectType<VNode>(<div />)
|
||||
@ -25,7 +25,13 @@ expectType<JSX.Element>(<div ref="bar" />)
|
||||
// allow Ref type type on arbitrary element
|
||||
const fooRef = ref<HTMLElement>()
|
||||
expectType<JSX.Element>(<div ref={fooRef} />)
|
||||
expectType<JSX.Element>(<div ref={(el) => {fooRef.value = el as HTMLElement}} />)
|
||||
expectType<JSX.Element>(
|
||||
<div
|
||||
ref={el => {
|
||||
fooRef.value = el as HTMLElement
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
expectType<JSX.Element>(
|
||||
<input
|
||||
@ -56,5 +62,8 @@ const Foo = defineComponent({
|
||||
// working
|
||||
;<Foo bar={1} />
|
||||
;<Foo bar={1} foo="baz" />
|
||||
|
||||
;<div slot="x" />
|
||||
|
||||
export default ({ data }: RenderContext) => {
|
||||
return <button {...data} />
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user