前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)

jk 1年前 ⋅ 1026 阅读

源于:今日头条(查看原文)

ORY是一家为维护安全而开发和维护开发工具的公司,ORY Editor就是他们公司的一个开源的、智能的、可扩展的现代编辑器("WYSIWYG")项目,如果你厌倦了contenteditable的局限性,这是一个不错的选择。目前他们的重点是优化ORY Editor和React的使用,在未来将会有不需要React的版本。

前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)

1、快速入门

https://github.com/ory/editor

我们的目标是创建一个ReactJS应用程序,来使用ORY Editor,在此之前请确保你已经正确安装node.js。目前ORY Editor只能通过npm和ReactJS环境达到最好的效果。

打开cmd,进入任意位置,运行命令

  • (全局安装create-react-app)

  • npm i -g create-react-app

  • (my-app项目名称,自定义,下同)

  • create-react-app my-app

  • (进入项目根目录)

  • cd my-app

  • (安装ORY Editor)

  • npm install --save ory-editor

  • (运行项目)

  • npm start

注意,如果发生错误,请删除node_modules文件夹,使用npm淘宝镜像安装。

  • (安装淘宝镜像)

  • npm install -g cnpm --registry=https://registry.npm.taobao.org

  • (进入项目根目录)

  • cd my-app

  • (安装项目依赖,生成node_modules文件夹)

  • cnpm install

  • (安装ORY Editor)

  • cnpm install --save ory-editor

  • (运行项目)

  • npm start

前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)

打开src/App.js文件,输入如下代码即可,运行命令:

npm install --save react-tap-event-plugin

前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)

前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)

前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)

2、基本功能展示

①文本编辑

前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)

②添加插件到内容

前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)

③移动位置

前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)

④调整大小

前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)

3、ORY Editor的插件

①富文本

前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)

前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)

②图像编辑,不支持上传

前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)

前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)

③视频编辑,不支持上传

前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)

④间隔区,用来固定空间高度

前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)

⑤视差背景

前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)


我们可以使用ORY Editor进行网站编辑、创建网站,你可以创建自己的设计和插件。

http://www.ory.am/sites/?utm_source=github-editor&utm_medium=link

前端开发:基于React和Redux可定制的内容编辑器(ORY Editor)

有哪里写得不好的地方请大家提出来,请轻喷,谢谢。 同时有什么与编程相关的好东西可以推举给我,再次感谢!


全部评论: 0

    我有话说: