We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
目前的render方法中部分内容完全可以在编译时处理完:
// 第一阶段添加id的这部分 const usageDomSet = new Set<string>(); template.replace(/{{(.*?)}}/g, (_, _key, start) => { const dom = findDomStr(start, template); usageDomSet.add(dom); return _; }); usageDomSet.forEach((dom) => { let id = ""; if (dom.indexOf("id=") === -1) { id = getRandomID(); const newDom = dom.replace(">", ` id="${id}">`); template = template.replace(dom, newDom); } });
同时,replace本身是具体性能损耗的,考虑编译时直接收集好数据,不要重复replace
The text was updated successfully, but these errors were encountered:
前提:去掉:if的rerender,换其他方式实现
Sorry, something went wrong.
rerender可以通过保存一份原始DOM的方式实现,每次通过clone来得到
No branches or pull requests
目前的render方法中部分内容完全可以在编译时处理完:
同时,replace本身是具体性能损耗的,考虑编译时直接收集好数据,不要重复replace
The text was updated successfully, but these errors were encountered: