vue icon indicating copy to clipboard operation
vue copied to clipboard

conflict between docs and typescript api

Open LongTengDao opened this issue 5 years ago • 1 comments

Version

2.6.10

Reproduction link

Steps to reproduce

What is expected?

Figure out which is exact.

What is actually happening?

doc:

https://github.com/vuejs/vuejs.org/blame/master/src/v2/guide/render-function.md#L142

doc said the first argument of createElement could be string/ComponentOptions or async return them (string/ComponentOptions),

tsd:

https://github.com/vuejs/vue/blame/dev/types/vue.d.ts#L18

while tsd file need string/ComponentOptions/ComponentConstructor (add ComponentConstructor) or sync return ComponentOptions/ComponentConstructor (both added) or async return ComponentOptions/ComponentConstructor (no string and add ComponentConstructor).

LongTengDao avatar Sep 11 '19 11:09 LongTengDao

import Vue, { ComponentOptions, ComponentConstructor } from 'vue';

declare module 'vue/types/vue' {
  interface VueConstructor {
    extend<Instance extends Vue, Data, Methods, Computed, Props>(
      options?: ComponentOptions<Instance, Data, Methods, Computed, Props>
    ): ComponentConstructor<Instance>;
  }
}

declare module 'vue/types/options' {
  interface ComponentOptions<V extends Vue> {
    extends?: ComponentOptions<V> | ComponentConstructor<V>;
  }
}

ljluestc avatar Dec 26 '23 18:12 ljluestc