forked from nextapps-de/mikado
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic.html
More file actions
42 lines (36 loc) · 1022 Bytes
/
basic.html
File metadata and controls
42 lines (36 loc) · 1022 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<html lang="en">
<head>
<title>Mikado Basic Example</title>
</head>
<body>
<div id="root"></div>
<template id="basic">
<div class="{{data.class}}">
<div class="title">{{data.title}}</div>
<div class="content">{{data.content}}</div>
</div>
</template>
<script src="https://rawcdn.githack.com/nextapps-de/mikado/master/dist/mikado.min.js"></script>
<script>
(function(){
const root = document.getElementById("root");
const template = Mikado.compile("basic");
const view = Mikado(root, template);
const data = [{
"class": "yellow green",
"title": "This is title 1",
"content": "This is content 1"
},{
"class": "",
"title": "This is title 2",
"content": "This is content 2"
},{
"class": "blue red",
"title": "This is title 3",
"content": "This is content 3"
}];
view.render(data);
}());
</script>
</body>
</html>