Evan You 9 лет назад
Родитель
Сommit
deae1ff851
3 измененных файлов с 4 добавлено и 4 удалено
  1. 2 2
      types/options.d.ts
  2. 1 1
      types/test/options-test.ts
  3. 1 1
      types/test/vue-test.ts

+ 2 - 2
types/options.d.ts

@@ -57,10 +57,10 @@ export interface ComponentOptions<V extends Vue> {
 }
 
 export interface FunctionalComponentOptions {
+  name?: string;
   props?: string[] | { [key: string]: PropOptions | Constructor | Constructor[] };
   functional: boolean;
-  render(this: never, createElement: CreateElement, context: RenderContext): VNode;
-  name?: string;
+  render(this: never, createElement: CreateElement, context: RenderContext): VNode | void;
 }
 
 export interface RenderContext {

+ 1 - 1
types/test/options-test.ts

@@ -92,7 +92,7 @@ Vue.component('component', {
       createElement("div", "message"),
       createElement(Vue.component("component")),
       createElement({} as ComponentOptions<Vue>),
-      createElement({ functional: true }),
+      createElement({ functional: true, render () {}}),
 
       createElement(() => Vue.component("component")),
       createElement(() => ( {} as ComponentOptions<Vue> )),

+ 1 - 1
types/test/vue-test.ts

@@ -83,7 +83,7 @@ class Test extends Vue {
     this.directive("", {bind() {}});
     this.filter("", (value: number) => value);
     this.component("", { data: () => ({}) });
-    this.component("", { functional: true });
+    this.component("", { functional: true, render () {}});
     this.use;
     this.mixin(Test);
     this.compile("<div>{{ message }}</div>");