请根据古腾堡官方按钮块粘贴完整代码。您需要具有其他块属性才能用于按钮链接、文本-
https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/button/index.js
<RichText.Content
tagName="a"
className={ linkClass }
href={ url }
title={ title }
style={ buttonStyle }
value={ text }
/>
正如你所看到的,有一个
URL, Title & Text 属性。
url: {
type: \'string\',
source: \'attribute\',
selector: \'a\',
attribute: \'href\',
},
title: {
type: \'string\',
source: \'attribute\',
selector: \'a\',
attribute: \'title\',
},
text: {
type: \'array\',
source: \'children\',
selector: \'a\',
},