widgets/index.js

11 lines
346 B
JavaScript
Raw Normal View History

2024-05-16 05:00:08 +08:00
import { div, span, pre } from './main.js'
2024-01-12 04:38:20 +08:00
2024-05-16 05:00:08 +08:00
document.body.appendChild(div.w(128).h(64).childs([
span.text('Hello world!'),
new span({ textContent: 'Hello world!' }),
2024-05-15 22:38:07 +08:00
]))
2024-01-12 04:38:20 +08:00
2024-05-16 05:00:08 +08:00
fetch('/index.js').then(res => res.text()).then(text => {
document.body.appendChild(pre.p('2rem').bg('#ececec').text(text.substring(0, text.indexOf('fetch'))))
})