mirror of
https://github.com/vuejs/vue.git
synced 2024-11-21 20:28:54 +00:00
parent
cdd2df6171
commit
52a59790a5
@ -1148,6 +1148,7 @@ defineComponent({
|
||||
this.$on('foo', () => {})
|
||||
this.$ssrContext
|
||||
this.$isServer
|
||||
this.$children[0].$root.$children
|
||||
return h('div', {}, [...this.$slots.default!])
|
||||
}
|
||||
})
|
||||
|
@ -16,6 +16,7 @@ class Test extends Vue {
|
||||
this.$isServer
|
||||
this.$ssrContext
|
||||
this.$vnode
|
||||
this.$root.$children[0].$children[0]
|
||||
}
|
||||
|
||||
// test property reification
|
||||
|
10
types/vue.d.ts
vendored
10
types/vue.d.ts
vendored
@ -35,6 +35,8 @@ export interface CreateElement {
|
||||
): VNode
|
||||
}
|
||||
|
||||
type NeverFallback<T, D> = [T] extends [never] ? D : T
|
||||
|
||||
export interface Vue<
|
||||
Data = Record<string, any>,
|
||||
Props = Record<string, any>,
|
||||
@ -47,10 +49,10 @@ export interface Vue<
|
||||
// properties with different types in defineComponent()
|
||||
readonly $data: Data
|
||||
readonly $props: Props
|
||||
readonly $parent: Parent extends never ? Vue : Parent
|
||||
readonly $root: Root extends never ? Vue : Root
|
||||
readonly $children: Children extends never ? Vue[] : Children
|
||||
readonly $options: ComponentOptions<Vue>
|
||||
readonly $parent: NeverFallback<Parent, Vue>
|
||||
readonly $root: NeverFallback<Root, Vue>
|
||||
readonly $children: NeverFallback<Children, Vue[]>
|
||||
readonly $options: NeverFallback<Options, ComponentOptions<Vue>>
|
||||
$emit: Emit
|
||||
|
||||
// Vue 2 only or shared
|
||||
|
Loading…
Reference in New Issue
Block a user