1.0.11 • Published 3 years ago

quill-react-editor v1.0.11

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Nights Editor

一个好用的 QuillEditor 框架。Nice Editor

QuillEditor

propstype
submitRefRefObject
contentcontent
position'top'/'bottom'
toolbarboolean
placeholderboolean
maxPictureNumstring
maxLetternumber
uploadFile(file: File) => Promise<stringvoid>
setValue(val: string) => void
getValue(val: string) => void
import { QuillEditor } from "quill-react-editor";
  const [content, setContent] = useState<string>();
  const submitRef = useRef<any>();
  function Index() {
    const [visible, setVisible] = useState(false);
    async function uploadFile(file: File) {
    if (file) {
      console.log("file", file)
      const url = 'https://tse3-mm.cn.bing.net/th/id/OIP-C.h3UCtqDkFOx_yX4npRjy7AHaEo?pid=ImgDet&rs=1'
      return url
      }
    }
    const publish = () => {
      console.log('You have clicked button,the content is ',content)
    }

    return (
      <div>
        <QuillEditor
          position="top"
          setValue={(value: string) => setContent(value)}
          submitRef={submitRef}
          uploadFile={uploadFile}
          maxLetter={500}
          maxPictureNum={6}
          placeholder={"请描述你遇到的问题"}
          toolbar={false}
        />
        <button
        className={styles.publishBtn}
        ref={submitRef}
        onClick={publish}
      >
        发布
      </button>
      </div>
    );
}

未完待续...

1.0.11

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago