lepisi-pengumuman/App/Views/Data/mithril.html

39 lines
779 B
HTML

{% extends "base.html" %}
{% block title %}Mithril{% endblock %}
{% block body %}
<main class="documentation">
<section id="mit">
</section>
</main>
<script>
var count = 0
var Hello = {
view: function() {
return m("main", [
m("h1", "Mithril"),
m("code", "You do " + count + " clicks"),
m("button", {onclick: function() {
count++
}}, "Click"),
])
}
}
var Splash = {
view: function() {
return m("a", {href: "#!/hello"}, "Enter!")
}
}
var root = document.getElementById('mit')
m.route(root, "/splash", {
"/splash": Splash,
"/hello": Hello,
})
</script>
{% endblock %}