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 > องค์ประกอบเว็บนี้ช่วยให้คุณ:
คุณมีตัวเลือกเล็กน้อย (เลือกหนึ่งในนั้น):
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 > ด้วยขอบคุณผู้คนต่อไปนี้: