这是来自试剂docs .
(defn mountit []
(r/render-component [childcaller]
(.-body js/document))) ; (.-body) what is this?
最佳答案
这是 JavaScript 互操作,访问 document
的 body
属性,与 JavaScript 中的 document.body
相同。请参阅:http://cljs.info/cheatsheet/ .因此 Reagent 组件将挂载在页面的 body
元素上。
关于clojurescript - 这个语法 (.-body ...) 在 clojurescript/reagent 中是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40821570/