admin管理员组文章数量:1125090
I have 2 custom blocks, "super-tabs" and "super-tab". Tabs has an inspector control that determines how many tab blocks will be in the tabs block. But when I change the number of tabs, it doesn't change the number of tab blocks. I can lock the innerblocks, but then I won't be able to edit the content of the super-tab block.
How can I have it so changing the number of tabs (numTabs) actually adds new tabs, but also allows them to be editable?
My code looks like this:
let defaultChildren = [];
for (let i = 1; i <= numTabs; i++) {
defaultChildren.push(["super-tabs/super-tab", {}, [["core/paragraph",{content:'Tab'+i}]]]);
}
...
return wp.element.createElement(wp.blockEditor.InnerBlocks, {template: defaultChildren})
本文标签: block editorHow can I lock innerblocks but not it39s content
版权声明:本文标题:block editor - How can I lock innerblocks but not it's content? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736641058a1945994.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论