我想从 clojurescript 设置 element.style.height 属性,但不幸的是这段代码失败了:
(set! (-> (sel1 tr :.ragslide) .-style .-height) (content-height))
Run Code Online (Sandbox Code Playgroud)
(sel1 选择一个 DOM 元素,它是来自 Dommy 库的宏)
出现以下错误:
clojure.lang.ExceptionInfo:
Assert failed: Can't set! local var or non-mutable field
(or (nil? local) (and (:field local) (or (:mutable local) (:unsynchronized-mutable local) (:volatile-mutable local)))) at line 79 {:tag :cljs/analysis-error, :file nil, :line 79, :column 7}
Run Code Online (Sandbox Code Playgroud)
如何设置该属性?
| 归档时间: |
|
| 查看次数: |
1865 次 |
| 最近记录: |