答案 0 :(得分:5)
现在,根据Dan Shryock的回答here和this post,我就是这样做的:
npm install -g live-server
live-server
用它创建一个live-view.md文件(把它放在你想要的任何地方。我把它放在我所有项目的基础文件夹中,因为我可以将它用于我目前正在处理的任何事情) :
<div style="border:1px solid #777;position:absolute;left:10px;top:10px;bottom:10px;right:10px;">
<iframe src="http://localhost:8080/"; width="100%" height="100%" frameborder="0" />
</div>
在VS Code的第二个/拆分窗格中打开live-view.md,然后单击“打开预览”按钮(文件右上角)。
现在每当我保存时,我都会看到实时预览中显示的更改。
答案 1 :(得分:2)
目前,我在这里解决它: 编辑文件
C:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\parts\
markdown\browser\resources\welcome-mac.md
拥有超级管理员权限,并添加
<input type="text" value="http://127.0.0.1:8080/" id="preview" onkeydown="var k = event.which; if (k==8) this.value = this.value.slice(0, -1);else if (k==13) document.getElementById('prevButton').click(); else this.value+=String.fromCharCode((96 <= k && k <= 105)? k-48 : k); "/>
<input type="button" onclick="window.location.replace(document.getElementById('preview').value);" value="Preview" id="prevButton" />
最后为你的HTML主体添加白色背景