我的代言人过去常和Fig轮一起工作。但是我不能让他们用影子cljs来显示。
影子发出了这样的信息:
影子-cljs- HTTP服务器,用于:http://localhost:3450提供的卡
名称空间cards.card-ui只是一系列的需求。
我在cards.card-ui中有一条正在显示的cards.card-ui消息。
在shadow-cljs.edn中,我有两个:builds。这是第二个:
:cards {:target :browser
:output-dir "resources/public/js/cards"
:asset-path "js/cards"
:modules {:main {:entries [cards.card-ui]}}
:compiler-options {:static-fns false}
:devtools {:http-root "resources/public"
:http-resource-root "resources/public"
:http-port 3450
:http-handler shadow.http.push-state/handle
:push-state/index "cards.html"
:preloads [devtools.preload
default-db-format.preload]}
:dev {:compiler-options {:devcards true}}
}cards.html有一个带有id "app“的div标记的body标记。我把浏览器带到http://localhost:3450/cards.html,得到一个空白页。我最好的理论是,cards.card-ui名称空间没有在app上挂载。
发布于 2018-06-19 10:48:06
目前,获得使用影子cljs而不是Fig轮的Fulcro应用程序示例的唯一方法是通过lein模板。因此,在命令提示符下:
lein new fulcro app shadow-cljs在这里,app是您选择的任何名称,shadow-cljs是一个选项。在研究了最终的应用程序之后,我意识到命名空间cards.card-ui不应该仅仅是一个需求列表,而且还需要有这些行:
(devcards.core/start-devcard-ui!)
(defn refresh []
(println "In cards.card-ui that starts the ui")):cards在shadow-cljs.edn中的构建变得更简单了:
:cards {:target :browser
:output-dir "resources/public/js/cards"
:asset-path "js/cards"
:compiler-options {:devcards true}
:modules {:main
{:entries [cards.card-ui]}}
:devtools {:after-load cards.card-ui/refresh
:http-root "resources/public"
:http-port 3450}
}我的另一个错误是HTML (cards.html)。下面是标记的body标记:
<body>
<div id="app"></div>
<script src="js/cards/main.js"></script>
</body>从Devcards站点导入一些指针:https://github.com/bhauman/devcards#usage-without-figwheel
lein模板项目:https://github.com/fulcrologic/fulcro-lein-template
https://stackoverflow.com/questions/50911612
复制相似问题