Your first component
Plain Component
import { Component, html } from 'vistajs/dom';
import { bootstrap } from 'vistajs/boot';
const App = Component('my-component', () => {
return () => html`<p>Hello World</p>`;
})
const root = document.querySelector('#root') as Element;
bootstrap(root, App)<my-component>
<p>Hello World</p>
</my-component>Binding values
Simple binding
import {Component, html} from 'vistajs/dom';
import {bootstrap} from 'vistajs/boot';
const App = Component('my-component', () => {
const name = 'John'
return () => html`<p>Hello, ${name}</p>`;
})
const root = document.querySelector('#root') as Element;
bootstrap(root, App)<my-component>
<p>Hello, John</p>
</my-component>Property binding
Simple values
Reactive values
Last updated