我为一位客户写了一个特定的区块。它工作得很好。我填写数据。我保存,当我在网站上查看时,它非常完美。但是,当我刷新编辑器时,我收到了这个错误。
非常感谢!
块。min.js?版本=9ed25ffa009c799f99a4340915b6dc6a:3块验证:的块验证失败perso-chacha/bloc-sous-forme-de-template
({名称:perso chacha/bloc sous forme de template,图标:{…},关键字:数组(0),属性:{…},providesContext:{…},…})。
内容生成人save
功能:
<section class="chacha-column valign-center chacha-bloc-sous-forme-de-template block_891836fd-a657-41da-ba9b-ab915bfc1308"><style>
section.block_891836fd-a657-41da-ba9b-ab915bfc1308{
--section_background_color: #163F47;
--title-font-family: \'undefined\';
--title-font-color: #FFFFFF;
--content_1-font-family: \'undefined\';
--content_1-font-color: #BFFFFF;
--content_2-font-family: \'undefined\';
--content_2-font-color: #FFFFFF;
--content_3-font-family: \'undefined\';
--content_3-font-color: #FFFFFF;
}
</style><div class="container"><h2 class="title">sdfsfsdfsdf</h2><div class="content_1"><p></p></div><div class="chacha-row"><div class="content_2"><p></p></div><div class="content_3"><p></p></div></div></div></section>
从帖子正文检索的内容:
<section class="chacha-column valign-center chacha-bloc-sous-forme-de-template block_891836fd-a657-41da-ba9b-ab915bfc1308"><style>
section.block_891836fd-a657-41da-ba9b-ab915bfc1308{
--section_background_color: #163F47;
--title-font-family: \'undefined\';
--title-font-color: #FFFFFF;
--content_1-font-family: \'undefined\';
--content_1-font-color: #BFFFFF;
--content_2-font-family: \'undefined\';
--content_2-font-color: #FFFFFF;
--content_3-font-family: \'undefined\';
--content_3-font-color: #FFFFFF;
}
</style><div class="container"><h2 class="title">sdfsfsdfsdf</h2><div class="content_1"><p>sdfsdfsdfsf</p><p>sdfsdfsdfsfd</p></div><div class="chacha-row"><div class="content_2"><p>sdfsdfsdfsf</p><p>sdfsdfsdf</p></div><div class="content_3"><p>sdfsdfsdfsf</p><p>sdfsdfsdfsdf</p></div></div></div></section>
这是我的救命稻草。js公司
import { RichText } from \'@wordpress/block-editor\';
export default function Save( props ) {
const notDefined = ( typeof props.className === \'undefined\' || !props.className ) ? true : false
const { title_font, subtitle_font, content_font, slogan_font, link_font, title_color, slogan_color } = props.attributes;
const currentDate = new Date();
props = Object.assign(props, {
className: notDefined ? `chacha-column valign-center chacha-notre-approche block_${ currentDate.getTime() }` : `chacha-column valign-center chacha-notre-approche block_${ currentDate.getTime() } ${ props.className }`,
});
var css = `
section.block_`+currentDate.getTime()+`{
--title-font-family: \'`+title_font+`\';
--title-font-color: `+title_color+`;
--subtitle-font-family: \'`+subtitle_font+`\';
--content-font-family: \'`+content_font+`\';
--slogan-color: `+slogan_color+`;
--slogan-font-family: \'`+slogan_font+`\';
--link-font-family: \'`+link_font+`\';
}
`;
return (
<section {...props}>
<style>{ css }</style>
<div class="chacha-row wrap">
<div class="chacha-cell">
<RichText.Content
tagName="h2"
className="title"
value={ props.attributes.title }
/>
</div>
<div class="chacha-cell">
<RichText.Content
tagName="h3"
className="subtitle"
value={ props.attributes.subtitle }
/>
<RichText.Content
tagName="p"
className="content"
value={ props.attributes.content }
/>
<RichText.Content
tagName="p"
className="slogan"
value={ props.attributes.slogan }
/>
{props.attributes.link_show && props.attributes.link_text &&
<a
href={ props.attributes.link_url }
className="chacha-row valign-center"
>
{props.attributes.link_icon_id &&
<img
src={ props.attributes.link_icon_url }
alt={ props.attributes.title }
/>
}
<span>{ props.attributes.link_text }</span>
</a>
}
</div>
</div>
</section>
);
};