Skip to content

Commit

Permalink
examples
Browse files Browse the repository at this point in the history
  • Loading branch information
big-camel committed May 22, 2022
1 parent 462be27 commit 6dfad29
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions examples/react/components/editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { cards, pluginConfig, plugins } from './config';
import Toolbar, { ToolbarItemProps } from './toolbar';
import './index.less';
import ReactDOM from 'react-dom';
import { IS_DEV } from '../../config';

export type Content = {
value: string;
Expand Down Expand Up @@ -135,18 +136,23 @@ const EditorComponent: React.FC<EditorProps> = ({
//自动保存,非远程更改,触发保存
if (trigger !== 'remote') autoSave();
if (props.onChange) props.onChange(trigger);
// const value = engine.current?.getValue();
// 获取编辑器的值
// console.log(`value ${trigger} update:`, value);
// 获取当前所有at插件中的名单
// console.log(
// 'mention:',
// engine.current?.command.executeMethod('mention', 'getList'),
// );
// 获取编辑器的html
// console.log('html:', engine.current?.getHtml());
// 获取编辑器的json
// console.log('json:', engine.current?.getJsonValue());
if (IS_DEV) {
const value = engine.current?.getValue();
// 获取编辑器的值
console.log(`value ${trigger} update:`, value);
// 获取当前所有at插件中的名单
console.log(
'mention:',
engine.current?.command.executeMethod(
'mention',
'getList',
),
);
// 获取编辑器的html
console.log('html:', engine.current?.getHtml());
// 获取编辑器的json
console.log('json:', engine.current?.getJsonValue());
}
},
[loading, autoSave, props.onChange],
),
Expand Down

0 comments on commit 6dfad29

Please sign in to comment.