File tree Expand file tree Collapse file tree 4 files changed +41
-26
lines changed
Expand file tree Collapse file tree 4 files changed +41
-26
lines changed Original file line number Diff line number Diff line change 11import React from "react" ;
2- import { Card } from "antd" ;
32import "codemirror/lib/codemirror.css" ;
43import "@toast-ui/editor/dist/toastui-editor.css" ;
54import { Editor } from "@toast-ui/react-editor" ;
6- import TypingCard from "@/components/TypingCard" ;
75const Markdown = ( ) => {
8- const cardContent = `此页面用到的Markdown编辑器是<a href="https://github.com/nhn/tui.editor/tree/master/apps/react-editor" target="_blank">tui.editor(React版)</a>` ;
96 return (
10- < div className = "app-container" >
11- < TypingCard title = "Markdown编辑器" source = { cardContent } />
12- < br />
13- < Card bordered = { false } >
14- < Editor
15- initialValue = "hello 难凉热血!"
16- previewStyle = "vertical"
17- height = "600px"
18- initialEditType = "markdown"
19- useCommandShortcut = { true }
20- />
21- </ Card >
22- </ div >
7+ < Editor
8+ initialValue = "hello 难凉热血!"
9+ previewStyle = "vertical"
10+ height = "600px"
11+ initialEditType = "markdown"
12+ useCommandShortcut = { true }
13+ />
2314 ) ;
2415} ;
2516
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import { Editor } from 'react-draft-wysiwyg';
55import draftToHtml from 'draftjs-to-html' ;
66import draftToMarkdown from 'draftjs-to-markdown' ;
77import 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css' ;
8- import TypingCard from '@/components/TypingCard'
98import "./index.less"
109class RichTextEditor extends Component {
1110 state = {
@@ -17,12 +16,9 @@ class RichTextEditor extends Component {
1716 } ) ;
1817 } ;
1918 render ( ) {
20- const cardContent = `此页面用到的富文本编辑是<a href="https://github.com/jpuri/react-draft-wysiwyg">react-draft-wysiwyg</a>`
2119 const { editorState } = this . state ;
2220 return (
23- < div className = "app-container" >
24- < TypingCard title = '富文本编辑器' source = { cardContent } />
25- < br />
21+ < div >
2622 < Card bordered = { false } >
2723 < Editor
2824 editorState = { editorState }
@@ -51,5 +47,4 @@ class RichTextEditor extends Component {
5147 }
5248}
5349
54-
5550export default RichTextEditor ;
Original file line number Diff line number Diff line change 11import React from "react" ;
2+ import { Card } from "antd" ;
23import Markdown from "@/components/Markdown" ;
3- export default ( ) => {
4- return < Markdown /> ;
4+ import TypingCard from "@/components/TypingCard" ;
5+
6+ const MarkdownDemo = ( ) => {
7+ const cardContent = `
8+ 此页面用到的Markdown编辑器是<a href="https://github.com/nhn/tui.editor/tree/master/apps/react-editor" target="_blank">tui.editor(React版)</a>。
9+ ` ;
10+ return (
11+ < div className = "app-container" >
12+ < TypingCard title = "新手引导" source = { cardContent } />
13+ < br />
14+ < Card bordered = { false } >
15+ < Markdown />
16+ </ Card >
17+ </ div >
18+ ) ;
519} ;
20+
21+ export default MarkdownDemo ;
Original file line number Diff line number Diff line change 11import React from "react" ;
22import RichTextEditor from "@/components/RichTextEditor" ;
3- export default ( ) => {
4- return < RichTextEditor /> ;
3+ import TypingCard from "@/components/TypingCard" ;
4+
5+ const RichTextEditorDemo = ( ) => {
6+ const cardContent = `
7+ 此页面用到的富文本编辑器是<a href="https://github.com/jpuri/react-draft-wysiwyg">react-draft-wysiwyg</a>。
8+ `
9+ return (
10+ < div className = "app-container" >
11+ < TypingCard title = "新手引导" source = { cardContent } />
12+ < br />
13+ < RichTextEditor />
14+ </ div >
15+ ) ;
516} ;
17+
18+ export default RichTextEditorDemo ;
You can’t perform that action at this time.
0 commit comments