edit, remove + toggle page modules

This commit is contained in:
2020-08-20 14:35:08 +02:00
parent 5319516922
commit 4abe35d422
19 changed files with 348 additions and 40 deletions
@@ -35,6 +35,7 @@
components: { UiEditor },
data: () => ({
isAdd: true,
disabled: false,
id: null,
loading: true,
@@ -48,11 +49,21 @@
onLoad(form)
{
form.load(!this.id ? ModulesApi.getEmpty(this.config.module.alias) : null).then(response =>
if (this.config.model)
{
this.isAdd = false;
this.model = JSON.parse(JSON.stringify(this.config.model));
}
form.load(ModulesApi.getEmpty(this.config.module.alias)).then(response =>
{
this.disabled = !response.meta.canEdit;
this.meta = response.meta;
this.model = response.entity;
if (this.isAdd)
{
this.model = response.entity;
}
this.loading = false;
});
},