Within the edit function of block.js
0 1 2 3 4 5 6 7 | var el = wp.element.createElement, Fragment = wp.element.Fragment, registerBlockType = wp.blocks.registerBlockType, InspectorControls = wp.editor.InspectorControls, RadioControl = wp.components.RadioControl, ColorPicker = wp.components.ColorPicker;//this this |
0 1 2 3 4 5 6 7 8 9 10 11 12 | el('div', {}, 'Menu Background'), el(ColorPicker, { type: 'color', color: menu_bg, onChangeComplete: function(newValue) { props.setAttributes({ menu_bg: newValue.hex }); }, disableAlpha: true }), |