1.0.2 • Published 2 years ago

@gmsoft/tiny-editor v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

tiny-editor

富文本编辑器 react 组件

usage

yarn add @gmsoft/tiny-editor
/**
 * demo
 */
import React from 'react';
import TinyEditor, { TinyViewer } from '@gmsoft/tiny-editor';

export default () => {
  const [value, setValue] = React.useState('');
  return (
    <>
      <TinyEditor
        // 如果需要使用图片上传功能, 要求服务器端返回的数据中包含 url 字段,url 字段值为图片的 url
        uploadServer="https://demo.com/file"
        defaultValue="place input something"
        value={value}
        onChange={setValue}
      />
      <div>
        value:
        <TinyViewer>{value}</TinyViewer>
      </div>
    </>
  );
};

usage 效果预览

preview

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago