显示元素后执行函数
Execute function once element is shown
在 reagent
通过
使用 luminus
创建的应用程序中
lein new luminus asdf +cljs
如何在显示元素后执行函数,例如下面代码段中的 :div.container
?
(defn about-page []
[:div.container
[:div.row
[:div.col-md-12
"this is the story of asdf... work in progress"]]])
刚刚看了the friendly manual :)发现luminus生成的app和标准试剂没什么区别
将上面的 about-page
函数更改如下即可。 about-page-rendered
是
(defn about-page-render []
[:div.container
[:div.row
[:div.col-md-12
"this is the story of asdf... work in progress"]]])
(defn about-page-rendered []
(do-what-ever-is-necessary))
(defn about-page []
(r/create-class {:reagent-render about-page-render
:component-did-mount about-page-rendered}))
在 reagent
通过
luminus
创建的应用程序中
lein new luminus asdf +cljs
如何在显示元素后执行函数,例如下面代码段中的 :div.container
?
(defn about-page []
[:div.container
[:div.row
[:div.col-md-12
"this is the story of asdf... work in progress"]]])
刚刚看了the friendly manual :)发现luminus生成的app和标准试剂没什么区别
将上面的 about-page
函数更改如下即可。 about-page-rendered
是
(defn about-page-render []
[:div.container
[:div.row
[:div.col-md-12
"this is the story of asdf... work in progress"]]])
(defn about-page-rendered []
(do-what-ever-is-necessary))
(defn about-page []
(r/create-class {:reagent-render about-page-render
:component-did-mount about-page-rendered}))