dev
pages-keywords dev
flyeditor 1.2.2

flyeditor 1.2.2






에디터 삽입

  1. import React, { useState } from 'react';
  2. import FlyEditor from 'flyeditor';
  3. import 'flyeditor/dist/flyeditor.css';

  4. const MyEditor = () => {
  5. const [initContent, setInitContent] = useState('<p>안녕하세요!</p>');
  6. const [content, setContent] = useState('');
  7. const [isEditable, setIsEditable] = useState(true);

  8. return (
  9. <div className="myeditor-container">
  10. <FlyEditor
  11. value={initContent}
  12. editable={isEditable}
  13. onChange={setContent}
  14. />
  15. </div>
  16. );
  17. };

  18. export default MyEditor;


에디터 뷰어

  1. import { FlyView } from 'flyeditor';
  2. import 'flyeditor/dist/flyeditor.css';
  3. ...

  4. const MyViewer = () => {

  5. const [dbContent, setDbContent] = useState('');

  6. useEffect(()=>{
  7. // 예시: 서버 데이터 조회 API 호출
  8. const res = await api.getContent();
  9. setDbContent(res);
  10. }, [])

  11. return (
  12. <div className="myviewer-container">
  13. <FlyView value={dbContent} />
  14. </div>
  15. );
  16. ...

  17. }


테스트 및 개발 가이드는 아래 링크에서...

https://flyeditor.dev/


flyeditor
react webeditor
리액트 웹에디터
웹에디터
webeditor
댓글 (0)
등록된 댓글이 없습니다.