簡體   English   中英

Figma 訪問主組件

[英]Figma access master components

有沒有辦法在沒有文檔中首先有實例的情況下遍歷masterComponents

此外,當組件更新時,組件的 UUID 是否會發生變化,並且該 UUID 在該組件的所有使用者中是否相同?

弄清楚了。 為它寫了一個實用程序 function

export function traverse(node: any) {
    if ("children" in node) {
        if (node.type !== "INSTANCE") {
            for (const child of node.children) {
                traverse(child)
                if (child.mainComponent) {
                    console.log(`name: ${child.mainComponent.name}`)
                    console.log(`key: ${child.mainComponent.key}`)
                }
            }
        }
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM