增加 HTML5 语义标签

This commit is contained in:
2024-05-14 16:28:24 +08:00
parent 74f5204bb3
commit 678ab6bf84
2 changed files with 215 additions and 1 deletions

214
main.js
View File

@ -15,6 +15,220 @@ export function createElement({ innerText, innerHTML, textContent, readOnly, chi
return element
}
/* HTML5 语义标签 */
export function Header(options) {
return createElement(options, 'header')
}
export function Nav(options) {
return createElement(options, 'nav')
}
export function Main(options) {
return createElement(options, 'main')
}
export function Article(options) {
return createElement(options, 'article')
}
export function Section(options) {
return createElement(options, 'section')
}
export function Aside(options) {
return createElement(options, 'aside')
}
export function Footer(options) {
return createElement(options, 'footer')
}
export function H1(options) {
return createElement(options, 'h1')
}
export function H2(options) {
return createElement(options, 'h2')
}
export function H3(options) {
return createElement(options, 'h3')
}
export function H4(options) {
return createElement(options, 'h4')
}
export function H5(options) {
return createElement(options, 'h5')
}
export function H6(options) {
return createElement(options, 'h6')
}
export function P(options) {
return createElement(options, 'p')
}
export function A(options) {
return createElement(options, 'a')
}
export function Strong(options) {
return createElement(options, 'strong')
}
export function Em(options) {
return createElement(options, 'em')
}
export function Small(options) {
return createElement(options, 'small')
}
export function Mark(options) {
return createElement(options, 'mark')
}
export function Del(options) {
return createElement(options, 'del')
}
export function Ins(options) {
return createElement(options, 'ins')
}
export function Pre(options) {
return createElement(options, 'pre')
}
export function Code(options) {
return createElement(options, 'code')
}
export function Blockquote(options) {
return createElement(options, 'blockquote')
}
export function Q(options) {
return createElement(options, 'q')
}
export function Cite(options) {
return createElement(options, 'cite')
}
export function Br(options) {
return createElement(options, 'br')
}
export function Hr(options) {
return createElement(options, 'hr')
}
export function Ol(options) {
return createElement(options, 'ol')
}
export function Ul(options) {
return createElement(options, 'ul')
}
export function Li(options) {
return createElement(options, 'li')
}
export function Dl(options) {
return createElement(options, 'dl')
}
export function Dt(options) {
return createElement(options, 'dt')
}
export function Dd(options) {
return createElement(options, 'dd')
}
export function Figure(options) {
return createElement(options, 'figure')
}
export function Figcaption(options) {
return createElement(options, 'figcaption')
}
export function Div(options) {
return createElement(options, 'div')
}
export function Table(options) {
return createElement(options, 'table')
}
export function Caption(options) {
return createElement(options, 'caption')
}
export function Thead(options) {
return createElement(options, 'thead')
}
export function Tfoot(options) {
return createElement(options, 'tfoot')
}
export function Tbody(options) {
return createElement(options, 'tbody')
}
export function Tr(options) {
return createElement(options, 'tr')
}
export function Th(options) {
return createElement(options, 'th')
}
export function Td(options) {
return createElement(options, 'td')
}
export function Col(options) {
return createElement(options, 'col')
}
export function Colgroup(options) {
return createElement(options, 'colgroup')
}
export function Td(options) {
return createElement(options, 'td')
}
export function Th(options) {
return createElement(options, 'th')
}
export function Thead(options) {
return createElement(options, 'thead')
}
export function Tfoot(options) {
return createElement(options, 'tfoot')
}
export function Tbody(options) {
return createElement(options, 'tbody')
}
export function Tr(options) {
return createElement(options, 'tr')
}
/* 扩展标签 */
export function List(options) {
return createElement(options, 'ul')
}

View File

@ -1,7 +1,7 @@
{
"name": "@laniakeasupercluster/widgets",
"description": "A simple widgets tracker",
"version": "1.0.1",
"version": "1.0.2",
"type": "module",
"main": "main.js",
"author": "Laniakea Supercluster <huan0016@gmail.com>",