语义标签继承

This commit is contained in:
2024-01-12 02:18:19 +08:00
parent f47f49642e
commit 593fb2d9ad
1 changed files with 11 additions and 3 deletions

14
main.js
View File

@ -12,7 +12,7 @@ export class div {
static get onclick() {
console.log('onclick event')
return {
stop: function(event) {
stop: function (event) {
console.log(`Stop event: ${event}`)
return div
}
@ -22,10 +22,10 @@ export class div {
static get onkeydown() {
console.log('onkeydown event')
return {
esc: function() {
esc: function () {
console.log('esc event')
return {
keydown: function() {
keydown: function () {
console.log('keydown event')
return div
}
@ -39,3 +39,11 @@ export class div {
return this
}
}
export class button extends div { }
export class span extends div { }
export class header extends div { }
export class footer extends div { }
export class main extends div { }