我正面临着一个奇怪的问题,我正在使用lit until等待返回模板的承诺,然而,“直到”的函数代码被呈现出来,对于ex,我有,
render() {
return html`
<div class="small-tool-card">
${this.renderProductLogo(product)}
<div class="text-container">
${this.renderProductTitle(product)}
${until(
this.renderTryLink(product),
html`
loading...
`
)}
</div>
</div>
`;
}而不是“装.”或者renderTryLink()的输出,它返回解析为html的承诺,我看到下面的代码正在呈现,
(part) => { let state = _state.get(part); if (state === undefined) { state = { lastRenderedIndex: _infinity, values: [], }; _state.set(part, state); } const previousValues任何帮助都将不胜感激。谢谢。
发布于 2022-04-19 12:10:33
改变
import { until } from 'lit-html/directives/until.js';至
import { until } from 'lit/directives/until.js';解决了这个问题。我相信,通过专门从lit导入,我们遗漏了其他指令。请注意,lit上的示例代码也需要修复。
https://stackoverflow.com/questions/71923741
复制相似问题