Open jockey100332 opened 3 years ago
const editorState = BraftEditor.createEditorState(`<div>${props.value}</div` || '<div></div>'); <BraftEditor ref={ref} controls={[]} extendControls={[ { key: 'custom-button', type: 'button', text: '按钮', onClick: () => { console.log(editorState); const newEditorState = ContentUtils.toggleSelectionColor(editorState, '#f39c12'); console.log(newEditorState.toHTML()); // ref.current.refs.toggleSelectionColor('#ffffff') // ref.current?.handleKeyCommand('blob') }, }, ]}
通过ContentUtils 方法没办法进行颜色的修改,是调用的方式不对吗?
发现 editorState.getSelection 该方法是无法获取到选中的内容
通过ContentUtils 方法没办法进行颜色的修改,是调用的方式不对吗?