Commit 8a58b1e3 by Lin Wang

fix

parent 7a41d3e0
...@@ -34,6 +34,21 @@ function handleFullDiffNode(node: any, path: string[], output: any) { ...@@ -34,6 +34,21 @@ function handleFullDiffNode(node: any, path: string[], output: any) {
}); });
} }
// 检查当前节点是否为 Buttons,并将其内部每个 Button 当成独立 Button 处理
if (node.type === "Buttons") {
// 直接获取 block1 下的 items 数组
const items = node.components.block1?.items || [];
items.filter((btn: any) => btn.type === "Button").forEach((btn: any) => {
output.result.push({
type: 'Button',
path: path.join('.'),
color: btn.color,
backgroundSettings: btn.backgroundSettings || {},
id: btn.id || null
});
});
}
// 检查当前节点是否为 Button // 检查当前节点是否为 Button
if (node.type === "Button") { if (node.type === "Button") {
output.result.push({ output.result.push({
...@@ -474,7 +489,7 @@ function parseJsonForStyles( ...@@ -474,7 +489,7 @@ function parseJsonForStyles(
} }
// 遍历子节点 // 遍历子节点
if (node.components) { if (node.components && node.type !== "Buttons") {
// Only traverse individual Button when no Buttons group is present // Only traverse individual Button when no Buttons group is present
let componentKeys = Object.keys(node.components); let componentKeys = Object.keys(node.components);
if (componentKeys.includes('buttons') && componentKeys.includes('button1')) { if (componentKeys.includes('buttons') && componentKeys.includes('button1')) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment