定义 <content> 标签的正确方法是什么?

What's the right way to define the <content> tag?

在WebComponents中为lightDOM定义插入点时,这两种语法有什么区别吗?

<template id="my-element">
    <content></content>
</template>

<template id="my-element">
    <content/>
</template>

定义标签的正确最佳方法是什么?

我在 Firefox/Chrome 中测试了两种语法,它们的行为相同(至少在简单测试中)。

看看https://developer.mozilla.org/en-US/docs/Web/HTML/Element/content :

Tag omission: None, both the starting and ending tag are mandatory.