0.2.16 • Published 3 years ago

jyq-text-editor v0.2.16

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

简介

这是一个简单的文本编辑器,支持表情和图片的输入

安装

npm install --save jyq-text-editor

更新日志

  • 0.1.0 -> 0.2.4
    • 不再以em为布局单位,而是以rem为布局单位
    • 删除了不需要的控制台输出

引入

import React from "react";
import TextEditor from "jyq-text-editor";
const MyApp = () => {
  return (
  	<div>
    	<TextEditor />
    </div>
  )
}
export default MyApp;

演示

npm.io npm.io npm.io npm.io npm.io npm.io

属性说明

属性说明示例
width编辑器宽度,单位为em,默认40emwidth="10em"
height编辑器高度,单位为emheight="5em"
placeholder占位提示placeholder="Enter something..."
scrollBar文字多时,是否显示滚动条scrollBar="false"
submitHandler点击发送时的回调函数,接受两个参数,第一个是文本内容,第二个是图片列表submitHandler={myHandler}
rootFontSize基准字体大小,默认为10px,组件内基本使用em作为计量单位,组件布局尺寸随此属性变动 现在以rem为布局单位,按需设置document元素的fontSizerootFontSize="12px"
// docuement的fontSize建议基准大小为10 默认用下面这个即可
let c = () => {
  let w = document.documentElement.clientWidth;
  let n = (10 * (w/1920)) > 40 ? 40 + "px" : (10 * (w/1920)) + "px";
  document.documentElement.style.fontSize = n;
};
window.addEventListener("load", c)
window.addEventListener("resize", c)

TODO

  • 添加自定义主色&高亮色属性
  • 代码结构调整
  • 样式调整
  • BUG修复
0.2.16

3 years ago

0.2.15

3 years ago

0.2.14

3 years ago

0.2.13

3 years ago

0.2.12

3 years ago

0.2.11

3 years ago

0.2.10

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago