chain-depict/index.js

14 lines
366 B
JavaScript

import { div, pre } from './main.js'
const main = div.w(64).h(64).text('main').absolute({ top: 32, left: 32 })
document.body.appendChild(main)
document.body.appendChild(div.w(128).h(64).text('Hello world').click(event => {
console.log('click !')
}))
fetch('./index.js').then(res => res.text()).then(text => {
document.body.appendChild(pre.text(text))
})