我正在尝试组合一个可变/混合内容旋转木马块。我在试图弄清楚如何在旋转木马中创建/删除单个幻灯片时遇到了一些问题(使用rangecontrol之类的工具)。
到目前为止,我有:
const ALLOWED_BLOCKS = [ \'core/paragraph\' ];
const BLOCKS_TEMPLATE = [
    [ \'core/columns\', {}, [] ],
];
registerBlockType( \'blocks/carousel\', {
    title: __( \'Carousel\' ),
    icon: \'layout\',
    attributes: {
        count: {
            type: \'number\',
        },
    },
    edit( { attributes, setAttributes, className } ) {
        const onChangeCount = value => {
            setAttributes( { count: value } );
        };
        return [
            <InspectorControls key="controls">
                <PanelBody>
                    <RangeControl
                        label={ __( \'Slides\' ) }
                        value={ attributes.count }
                        onChange={ onChangeCount }
                        min={ 2 }
                        max={ 6 }
                    />
                </PanelBody>
            </InspectorControls>,
            <div className={ className } key="content">
                <InnerBlocks
                    template={ BLOCKS_TEMPLATE }
                    allowedBlocks={ ALLOWED_BLOCKS }
                    templateLock="all"
                />
            </div>,
        ];
    },
    save( { attributes } ) {
        return (
            <div>
                <InnerBlocks.Content />
            </div>
        );
    },
} );
 因此,我不完全确定通过范围创建/删除幻灯片需要什么。如果有人能给我提供一个粗略的解决方案和/或指向我一些文档,我将不胜感激。