feat: 完善模板驱动的品牌内容工作台
This commit is contained in:
1 parent
77224ea51f
commit
dd55af8d73
46 files changed
+2204
-295
No files matched your search
@@ -22,6 +22,20 @@ function validateManifest(manifest) {
|
||||
}
|
||||
if (!Array.isArray(manifest.navigation) || !manifest.navigation.length)
|
||||
throw new Error("template.json navigation must not be empty");
|
||||
if (!Array.isArray(manifest.dataSlots) || !manifest.dataSlots.length)
|
||||
throw new Error("template.json dataSlots must not be empty");
|
||||
if (!Array.isArray(manifest.assetSlots))
|
||||
throw new Error("template.json assetSlots must be an array");
|
||||
if (!manifest.admin || !Array.isArray(manifest.admin.sections) || !manifest.admin.sections.length)
|
||||
throw new Error("template.json admin.sections must not be empty");
|
||||
for (const section of manifest.admin.sections) {
|
||||
if (!section.key || !section.title || !section.description || !Array.isArray(section.fields))
|
||||
throw new Error("template.json admin sections require key, title, description and fields");
|
||||
for (const field of section.fields) {
|
||||
if (!field.key || !field.binding || !field.label || !field.input)
|
||||
throw new Error("template.json admin fields require key, binding, label and input");
|
||||
}
|
||||
}
|
||||
if (
|
||||
manifest.renderers !== undefined &&
|
||||
(typeof manifest.renderers !== "object" || Array.isArray(manifest.renderers))
|
||||
|
||||
Reference in new issue
Block a user