我正在尝试修改Cover块,以接受更多内容,而不仅仅是内部块中的“ paragraph块”。我可以找到一些有关更改核心集团基本道具的教程,例如: https://jeffreycarandang.com/extending-gutenberg-core-blocks-with-custom-attributes-and-controls/ 在我看来,应该可以简单地更改edit函数的const,但是我的js知识不足以解决这一问题。
所以我需要更改以下const:
const INNER_BLOCKS_TEMPLATE = [
[
'core/paragraph',
{
align: 'center',
fontSize: 'large',
placeholder: __( 'Write title…' ),
},
],
];
例如阅读
const INNER_BLOCKS_TEMPLATE = [
[
'core/heading',
{
align: 'center',
level: 2,
placeholder: __( 'Write title…' ),
},
'core/paragraph',
{
align: 'center',
fontSize: 'normal',
placeholder: __( 'Write content…' ),
},
],
];