admin管理员组文章数量:1122832
When we add additional classes to our custom block they are not being added in the editor. When we save the block and view the front-end the additional classes are showing. But in the editor they won't show up.
Here is the code of our block:
import { useBlockProps } from '@wordpress/block-editor';
export default {
name: 'erik-dekker/button',
title: 'Knop',
icon: 'button',
category: 'erik-dekker',
edit: () => {
const blockProps = useBlockProps();
return (
<div { ...blockProps }>hello world!</div>
);
},
save: () => {
const blockProps = useBlockProps.save();
return (
<div { ...blockProps }>hello world!</div>
);
}
}
Thanks for your time!
本文标签: javascriptAdditional CSS classes not being added in Gutenberg editor
版权声明:本文标题:javascript - Additional CSS classes not being added in Gutenberg editor 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736311828a1934878.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论