domino 0.4.0 domino: ^0.4.0 copied to clipboard
An experimental virtual dom library, which allows mixing DOM elements with components.
import 'dart:html' as html;
import 'package:domino/domino.dart';
import 'package:domino/html_view.dart';
import 'package:domino/helpers.dart';
main() {
registerHtmlView(html.querySelector('#main'), new SimpleComponent());
}
class SimpleComponent extends Component {
int counter = 0;
@override
build(BuildContext context) {
return [
div([
div('Counter: $counter'),
button([#btn, 'Increment'], onClick: _onClick),
]),
];
}
void _onClick() {
counter++;
}
}