New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

zan-richtext

Package Overview
Dependencies
Maintainers
4
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zan-richtext

基于 UEditor 的 React 富文件编辑器

  • 5.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
4
Weekly downloads
 
Created
Source

zan-richtext

NPM

基于 UEditor 的 React 富文件编辑器

代码演示

:::demo 基础用法

import RichText from 'zan-richtext';

class Simple extends React.Component {

	state = {
		value: 'cafe babe'
	}

	componentWillMount() {
		setTimeout(() => {
			this.richTextEditor.editor.setContent('form ajax.');
		}, 5000);
	}

	onChange = (data) => {
		this.setState({
		  value: data
		});
	}

	render() {
		return (
			<div>
				<RichText
					ref={el => this.richTextEditor = el}
					value={this.state.value}
					onChange={this.onChange}
					editorConfig={{
						initialFrameWidth: 500
					}}
					uploadConfig={{
						materials: false
					}}
				/>
				<div style={{ marginTop: '20px' }}>
				    <p>结果:</p>
				    <div>{this.state.value}</div>
				</div>
			</div>
		);
	}
}

ReactDOM.render(
	<Simple />
	, mountNode
);

:::

API

非受控组件

参数说明类型默认值
className自定义额外类名string''
value富文本的值string''
onChange内容变化时的回调funcnoop
onReadyueditor的 ready 回调func''
ueditorUrlueditor.all.js 的cdn路径string'//b.yzcdn.cn/v2/vendor/ueditor/release/ueditor.all.min.201705122045.js'
ueditorConfigUrlueditor.config.js 的cdn路径string'//b.yzcdn.cn/v2/vendor/ueditor/release/ueditor.config.201705122045.js'
qiniuCdnUrl七牛 cdn 域名string'https://img.yzcdn.cn'
ueditorHomeUrlueditor 资源文件 cdn 路径string'//b.yzcdn.cn/v2/vendor/ueditor/dist/'
ueditorIframeUrlueditor iframe cdn 路径string'//www.youzan.com/v2/static/vendor/ueditor/dist/'
editorConfigueditor 的自定义配置object{}
uploadConfigupload 组件的自定义配置object{}
uploadImageRule七牛图片规则string'!730x0.jpg'

editorConfig 的自定义参数 fetchImgUrl 用来抓取远程图片, onFetchSuccess处理抓取成功数据的解析

更新日志

4.6.7 (2018-05-15)
  • [bug fix] 修复在 form 包裹下的 design 组件切换时多余 textarea 的问题
4.5.2 (2017-12-06)
  • [bug fix] 禁用插入链接弹窗敲回车自动提交表单的问题

FAQs

Package last updated on 03 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc