是否有任何 Vs Code 扩展可以在 JavaScript 字符串中语法突出显示 HTML?
具体来说,我正在编写网络组件
const html = content => `
<div>
<table>
${content}
</table>
</div>
`;
class BaseTable extends HTMLElement {
constructor() {
super();
}
set content(value) {
const template = document.createElement('template');
template.innerHTML = style + html(value);
this.attachShadow({ mode: 'open' });
this.shadowRoot.appendChild(template.content.cloneNode(true));
}
}
我想要突出显示 html 常量变量中的字符串
如果你使用lit-html,vs code中有一个插件叫lit-plugin,用于语法高亮。
语法是,
const markup = content => html`
<div>
<table>
${content}
</table>
</div>
`;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)