@observable editable = false;
@observable template = {};
@action("toggle editable")
toggleEditable = () => {
this.editable = !this.editable
};
@action("fill template")
fillTemplate = () => {
const fillTemplate = {};
for (let key in this.props.item) {
fillTemplate[key] = this.props.item[key];
}
this.template = fillTemplate;
};
@action("template edit")
templateEdit = (e, type) => {
this.template[type] = e.target.value
};
class CardStore {
@observable editable = false;
@action("toggle editable")
toggleEditable = () => {
this.editable = !this.editable
};
}
return (
<Provider {...stores}>
<React.Fragment>
{this.editable ? <Form /> : <Div />}
</React.Fragment>
</Provider>
);