Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
zan-richtext
Advanced tools
基于 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
);
:::
非受控组件
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
className | 自定义额外类名 | string | '' |
value | 富文本的值 | string | '' |
onChange | 内容变化时的回调 | func | noop |
onReady | ueditor的 ready 回调 | func | '' |
ueditorUrl | ueditor.all.js 的cdn路径 | string | '//b.yzcdn.cn/v2/vendor/ueditor/release/ueditor.all.min.201705122045.js' |
ueditorConfigUrl | ueditor.config.js 的cdn路径 | string | '//b.yzcdn.cn/v2/vendor/ueditor/release/ueditor.config.201705122045.js' |
qiniuCdnUrl | 七牛 cdn 域名 | string | 'https://img.yzcdn.cn' |
ueditorHomeUrl | ueditor 资源文件 cdn 路径 | string | '//b.yzcdn.cn/v2/vendor/ueditor/dist/' |
ueditorIframeUrl | ueditor iframe cdn 路径 | string | '//www.youzan.com/v2/static/vendor/ueditor/dist/' |
editorConfig | ueditor 的自定义配置 | object | {} |
uploadConfig | upload 组件的自定义配置 | object | {} |
uploadImageRule | 七牛图片规则 | string | '!730x0.jpg' |
editorConfig 的自定义参数 fetchImgUrl 用来抓取远程图片, onFetchSuccess处理抓取成功数据的解析
FAQs
基于 UEditor 的 React 富文件编辑器
The npm package zan-richtext receives a total of 0 weekly downloads. As such, zan-richtext popularity was classified as not popular.
We found that zan-richtext demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
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.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.