如果我有以下代码和函数,可以从'p‘标记切换到'h1’标记:
(def switch-tag (cell p))后来在山庄里
((cell= switch-tag) "Text goes here")为什么当我切换到h1标记时,似乎什么都没有发生。
发布于 2017-10-05 13:50:23
我一直无法用你的方式解决这件事。以下是一个解决办法:
(page "index.html")
(def key! (cell true))
(defelem my-elem [_ [child]]
(cell= (if key! (h1 child) (p child))))
(html
(body
(button :click #(swap! key! not) "test")
(my-elem "this is a test")))https://stackoverflow.com/questions/46554785
复制相似问题