ef.js Mounting Demo
by Yukino Song
HTML
<script src="https://cdn.jsdelivr.net/npm/ef.js@latest"></script>
JavaScript
const { t, inform, exec } = ef
inform()
const main = new t`
>div
.Mounting point 1:
>br
-mp1
>br
.Mounting point 2:
>br
-mp2
`
const Component = t`
>div
.This is component {{count}}.
`
const component1 = new Component({$data: {count: 1}})
const component2 = new Component({$data: {count: 2}})
main.mp1 = component1
main.mp2 = component2
main.$mount({target: document.body})
exec()