将数据从FocusableIframe传输到数据块

时间:2019-06-13 13:22:47

标签: wordpress plugins block wordpress-gutenberg gutenberg-blocks

我想在编辑器的iframe中进行选择,然后将选择转移到将在保存页面上显示的元素。如何将iFrame中的数据返回到已注册的块?

如何存储这些数据?

我当前无法正常工作的代码:

blocks.registerBlockType('XXX/XX-block', {
      stringToUpdate: {
        type: 'string',
      },
      edit: function(props) {
        return (el(components.FocusableIframe, {
              src: "https:///....my-iframe.php"
            },
          }
        }),
      save: function(props) {
        return (el('div', {
          className: 'stringToUpdate'
        }, 'stringToUpdate'))
      }

0 个答案:

没有答案