首页 > 解决方案 > 如何启用维度控制古腾堡?

问题描述

https://developer.wordpress.org/block-editor/reference-guides/components/dimension-control/ Docs 说DimensionControlwp.blockEditor 使用它。但我没有DimensionControl在 wp.blockEditor 或 wp.components 或 wp.element 中。该组件是默认启用还是需要手动启用?在此处输入图像描述

标签: wordpresswordpress-gutenberg

解决方案


维度控制组件现在位于 @wordpress-components 库或包中。

// https://github.com/WordPress/gutenberg/tree/trunk/packages/components/src

您也许可以像这样导入它。

import { DimensionControl } from '@wordpress/components';

或者

import { __experimentalDimensionControl } from '@wordpress/components';

显然它还不稳定,所以您可能需要等待,然后才能在生产中实际使用它。


推荐阅读