method m() 和 m.render() 有什么区别?
What is the difference between method m () and m.render () ? m.render() is always required?
m()
使得 virtualDom
?
m.render()
使得 realDom
?
这意味着总是需要 m.render()
?
是的,差不多!来自 Mithril 网站上的 m() documentation:
This is a convenience method to compose virtual elements that can be
rendered via m.render()
.
但是,除了 m.render()
之外,还有其他显示内容的方法,在组件的帮助下。来自 m.component() documentation page 的摘要:
There are three ways to render a component:
m.route
(if you are building a single-page application that has multiple pages)
m.mount
(if your app only has one page)
m.render
(if you are integrating Mithril's rendering engine into a larger framework and wish to manage redrawing yourself).
m()
使得 virtualDom
?
m.render()
使得 realDom
?
这意味着总是需要 m.render()
?
是的,差不多!来自 Mithril 网站上的 m() documentation:
This is a convenience method to compose virtual elements that can be rendered via
m.render()
.
但是,除了 m.render()
之外,还有其他显示内容的方法,在组件的帮助下。来自 m.component() documentation page 的摘要:
There are three ways to render a component:
m.route
(if you are building a single-page application that has multiple pages)m.mount
(if your app only has one page)m.render
(if you are integrating Mithril's rendering engine into a larger framework and wish to manage redrawing yourself).