我创建了一个自定义按钮块,并希望在其他块中使用它,例如 CTA 或图标功能。我在一些插件中看到了这样的代码,它导出注册块:
export default registerBlockType( 'name_space/button', {
但现在我想将它导入另一个块以供将来使用。像这样的东西:
import CustomButton from '../custom-button/block';
我试过用 and 将它包含在另一个edit
块的方法中。但每次我得到一个错误。{CustomButton}
<CustomButton />
我有办法做这样的事情吗?