component template
1.0.0
component-name...的Web組件
演示|進一步閱讀
一般用法示例:
< 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 > 感謝以下人員: