mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-04-22 21:18:39 +00:00
35 lines
580 B
JavaScript
Executable File
35 lines
580 B
JavaScript
Executable File
const Element = require('./Element');
|
|
const { noop } = require('./util');
|
|
|
|
class HTMLElement extends Element {
|
|
|
|
constructor(tagName = '') {
|
|
super()
|
|
this.tagName = tagName.toUpperCase()
|
|
|
|
this.className = ''
|
|
this.children = []
|
|
this.style = {
|
|
width: `${window.innerWidth}px`,
|
|
height: `${window.innerHeight}px`
|
|
}
|
|
|
|
this.innerHTML = ''
|
|
this.parentElement = window.__canvas
|
|
}
|
|
|
|
setAttribute(name, value) {
|
|
this[name] = value
|
|
}
|
|
|
|
getAttribute(name) {
|
|
return this[name]
|
|
}
|
|
|
|
focus() {
|
|
|
|
}
|
|
}
|
|
|
|
module.exports = HTMLElement;
|