Browse Source

fix(types): fix `renderError`arguments type (#8636)

fix #8635
dev
st-sloth 6 years ago
committed by Evan You
parent
commit
ac217d2472
  1. 2
      types/options.d.ts
  2. 3
      types/test/options-test.ts

2
types/options.d.ts

@ -70,7 +70,7 @@ export interface ComponentOptions<
template?: string; template?: string;
// hack is for funcitonal component type inference, should not used in user code // hack is for funcitonal component type inference, should not used in user code
render?(createElement: CreateElement, hack: RenderContext<Props>): VNode; render?(createElement: CreateElement, hack: RenderContext<Props>): VNode;
renderError?: (h: () => VNode, err: Error) => VNode; renderError?(createElement: CreateElement, err: Error): VNode;
staticRenderFns?: ((createElement: CreateElement) => VNode)[]; staticRenderFns?: ((createElement: CreateElement) => VNode)[];
beforeCreate?(this: V): void; beforeCreate?(this: V): void;

3
types/test/options-test.ts

@ -202,6 +202,9 @@ Vue.component('component', {
[createElement("div", "message")] [createElement("div", "message")]
]); ]);
}, },
renderError(createElement, err) {
return createElement('pre', { style: { color: 'red' }}, err.stack)
},
staticRenderFns: [], staticRenderFns: [],
beforeCreate() { beforeCreate() {

Loading…
Cancel
Save