mirror of
https://github.com/flarum/framework.git
synced 2025-05-25 16:19:57 +08:00
Allow components to initialise props
This commit is contained in:
@ -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();
|
||||||
|
Reference in New Issue
Block a user