Я создал пользовательский блок Gutenberg через npx @wordpress/create block, называемый Stat-Block, у меня есть index.js, edit.js, save.js, view.js и block.json. Я полагаю, что у меня есть все правильно, так как все мои атрибуты сохраняются, а круговой прогноз правильно отображается на фронте, однако бэкэнд в FSE не инициирует элемент обращения круга. Ниже приведен код в моем edit.js, что я делаю не так в своем коде? < /P>
import { useBlockProps, RichText, InspectorControls } from '@wordpress/block-editor';
import { PanelBody, RangeControl } from '@wordpress/components';
import { useEffect } from '@wordpress/element';
import CircleProgress from 'js-circle-progress';
export default function Edit({ attributes, setAttributes }) {
const { text, percentage } = attributes;
const blockProps = useBlockProps({
className: `stat-block`,
});
useEffect(() => {
const cp = new CircleProgress();
}, [percentage]);
return (
setAttributes({ percentage: value })}
min={0}
max={100}
step={1}
/>
setAttributes({ text: value })}
placeholder="Add stat text"
allowedFormats={['core/bold', 'core/italic']}
/>
);
}
Подробнее здесь: https://stackoverflow.com/questions/795 ... enberg-fse
Не может инициировать прогресс в круге JS в Гутенберге FSE ⇐ Javascript
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение