Skip to content

Commit

Permalink
修复 rule类型为 array 时报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
xaboy committed Aug 15, 2019
1 parent e925c8c commit 88f9c1b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ export class Render {
this.vm = vm;
}

render(): VNode | VNode[] {
render(): VNode {

//@ts-ignore
let rule = this.vm.jv_$rule;

if (isType(rule, 'Function'))
rule = (<Function>rule).call(this.vm);

return Array.isArray(rule) ? <VNode[]>rule.map(rule => {
return Array.isArray(rule) ? this.vm.$createElement('div', {}, rule.map(rule => {
return this.renderRule(rule);
}) : <VNode>this.renderRule(<Rule>rule);
})) : <VNode>this.renderRule(<Rule>rule);
}

renderRule(rule: Rule): VNode | VNode[] {
Expand Down

0 comments on commit 88f9c1b

Please sign in to comment.