update build
This commit is contained in:
parent
615b85bb96
commit
2e0a48d4a2
1 changed files with 11 additions and 11 deletions
22
index.html
22
index.html
|
|
@ -77,20 +77,20 @@
|
||||||
in addition to <tt>sci-script-tag.js</tt>, you need to include <tt>sci-script-tag-plugin-reagent.js</tt>.
|
in addition to <tt>sci-script-tag.js</tt>, you need to include <tt>sci-script-tag-plugin-reagent.js</tt>.
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<script src="https://borkdude.github.io/sci-script-tag/js/sci-script-tag-plugin-reagent.js" type="application/javascript"></script>
|
<script src="https://borkdude.github.io/sci-script-tag/js/sci-script-tag-plugin-reagent.js" type="application/javascript"></script>
|
||||||
<script type="application/x-sci">
|
<script type="application/x-sci">
|
||||||
(require '[reagent.core :as r]
|
(require '[reagent.core :as r]
|
||||||
'[reagent.dom :as rdom])
|
'[reagent.dom :as rdom])
|
||||||
|
|
||||||
(def state (r/atom {:clicks 0}))
|
(def state (r/atom {:clicks 0}))
|
||||||
|
|
||||||
(defn my-component []
|
(defn my-component []
|
||||||
[:div
|
[:div
|
||||||
[:p "Clicks: " (:clicks @state)]
|
[:p "Clicks: " (:clicks @state)]
|
||||||
[:p [:button {:on-click #(swap! state update :clicks inc)}
|
[:p [:button {:on-click #(swap! state update :clicks inc)}
|
||||||
"Click me!"]]])
|
"Click me!"]]])
|
||||||
|
|
||||||
(rdom/render [my-component] (.getElementById js/document "app"))
|
(rdom/render [my-component] (.getElementById js/document "app"))
|
||||||
</script>
|
</script>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue