画廊添加

This commit is contained in:
2026-08-08 11:57:08 +08:00
parent 0ba5c56b6e
commit c8b82f640e
14 changed files with 282 additions and 23 deletions
+18
View File
@@ -472,12 +472,21 @@ Json make_amis_view_node(const View_Node& node, const Json& descriptor_json, std
Json items = json_array<Json>();
for(const auto& child : node.children) {
Json item = json_object<Json>();
json_set(item, "type", "container");
json_set(item, "body", make_amis_view_body<Json, T>(child, descriptor_json, permission, prefix));
Json item_style = json_object<Json>();
json_set(item_style, "flex", "1 1 280px");
json_set(item, "style", std::move(item_style));
json_append(items, std::move(item));
}
Json result = json_object<Json>();
json_set(result, "type", "flex");
json_set(result, "direction", "row");
json_set(result, "items", std::move(items));
Json style = json_object<Json>();
json_set(style, "flexWrap", "wrap");
json_set(style, "gap", "12px");
json_set(result, "style", std::move(style));
apply_view_node_options(result, node, prefix);
return result;
}
@@ -606,12 +615,21 @@ Json make_amis_composition_node(const Composition_Node& node, const std::map<std
Json items = json_array<Json>();
for(const auto& child : node.children) {
Json item = json_object<Json>();
json_set(item, "type", "container");
json_set(item, "body", make_amis_composition_body<Json>(child, slots));
Json item_style = json_object<Json>();
json_set(item_style, "flex", "1 1 280px");
json_set(item, "style", std::move(item_style));
json_append(items, std::move(item));
}
Json result = json_object<Json>();
json_set(result, "type", "flex");
json_set(result, "direction", "row");
json_set(result, "items", std::move(items));
Json style = json_object<Json>();
json_set(style, "flexWrap", "wrap");
json_set(style, "gap", "12px");
json_set(result, "style", std::move(style));
apply_composition_node_options(result, node);
return result;
}