component template
1.0.0
component-nameのウェブコンポーネント…
デモ|さらに読む
一般的な使用例:
< script type =" module " src =" component-name.js " > </ script >
< component-name >
< button > Button </ button >
</ component-name >フォールバック方法を使用した例:
< script type =" module " src =" component-name.js " > </ script >
< component-name >
< button > Button </ button >
< a href =" # " > Anchor </ a >
</ component-name >
< style >
component-name:not(:defined) button,
component-name:defined a {
display: none;
}
</ style >オプションまたは追加のフォールバック方法を使用した例:
< script type =" module " src =" component-name.js " > </ script >
< component-name attribute =" value " >
< button > Button </ button >
</ component-name >
< style >
component-name[attribute="value"] {
outline: 1px solid red;
}
</ style > このWebコンポーネントを使用すると、次のことができます。
いくつかのオプションがあります(これらのいずれかを選択してください):
npm install @daviddarnes/component-nameプロジェクトに<script>を含めることを確認してください(これらのいずれかを選択してください)。
<!-- Host yourself -->
< script type =" module " src =" component-name.js " > </ script > <!-- 3rd party CDN, not recommended for production use -->
< script
type =" module "
src =" https://www.unpkg.com/@daviddarnes/[email protected]/component-name.js "
> </ script > <!-- 3rd party CDN, not recommended for production use -->
< script
type =" module "
src =" https://esm.sh/@daviddarnes/[email protected] "
> </ script > 次の人々に感謝します: