我是打字稿的新手。我有一个使用打字稿显示 html 的问题。下面是我的 HTML 代码:
<div itemprop="copy-paste-block">
<ul>
<li><span style="font-size:11pt;"><span style="font-family:Calibri,sans-serif;">ITS – signed support agreement</span></span>
<ul style="list-style-type:circle;">
<li><span style="font-size:11pt;"><span style="font-family:Calibri,sans-serif;">27 parts received to date.</span></span>
</li>
<li><span style="font-size:11pt;"><span style="font-family:Calibri,sans-serif;">Working larger structures package.</span></span>
</li>
</ul>
</li>
<li><span style="font-size:11pt;"><span style="font-family:Calibri,sans-serif;">GECAS </span></span>
<ul style="list-style-type:circle;">
<li><span style="font-size:11pt;"><span style="font-family:Calibri,sans-serif;">Working full ship set structures package.</span></span>
</li>
</ul>
</li>
<li><span style="font-size:11pt;"><span style="font-family:Calibri,sans-serif;">Skywest</span></span>
<ul style="list-style-type:circle;">
<li><span style="font-size:11pt;"><span style="font-family:Calibri,sans-serif;">Price rationalization presented to mgmt.</span></span>
</li>
</ul>
</li>
<li>United
<ul style="list-style-type:circle;">
<li><span style="font-size:11pt;"><span style="font-family:Calibri,sans-serif;">Single Radome oppty.</span></span>
</li>
</ul>
</li>
</ul>
</div>
当我使用
document.write(htmlcontent);
它显示正确,如下所示:
但是,当我使用
document.body.innerHTML = htmlcontent
显示已更改,缺少一些内容并更改了如下所示的一些格式
我想知道这是否应该发生......如果我应该做些什么来使 body.innerHTML 正确显示?谢谢。
慕运维8079593
相关分类