Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
fix: 修复 turboPages 模式使用 Fragment 可能死循环的问题 (#1161)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darmody committed Jul 16, 2020
1 parent f871ae1 commit ee897e8
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as t from '@babel/types';
import { NodePath } from '@babel/traverse';
import { TEMPLATE_ID, ENTRY } from '../constants';
import { TEMPLATE_ID, ENTRY, EXPRESSION_BLOCK } from '../constants';
import { createTemplate, templateInfoMap } from '../render/templates';
import { JSXNode, RenderNode } from '../types';
import * as helpers from '../helpers';
Expand Down Expand Up @@ -138,6 +138,12 @@ export default function render(api: API) {
return;
}

// block 动态模板不应该生成 templateID
const name = (node.node.openingElement.name as any).name;
if (name === EXPRESSION_BLOCK) {
return;
}

const module = state.filename;
const templateID = markTemplateID(node.node.openingElement);

Expand Down

0 comments on commit ee897e8

Please sign in to comment.