1
0
mirror of https://github.com/flarum/core.git synced 2025-07-25 18:51:40 +02:00

Allow components to initialise props

This commit is contained in:
Toby Zerner
2015-05-02 08:45:11 +09:30
parent d5a3e3d2c6
commit 8e423c9dfe

View File

@@ -23,6 +23,9 @@ export default class Component {
*/ */
static component(props) { static component(props) {
props = props || {}; props = props || {};
if (this.props) {
props = this.props(props);
}
var view = function(component) { var view = function(component) {
component.props = props; component.props = props;
return component.view(); return component.view();