• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

JedWatson/react-md-editor: React.js Markdown Editor Component

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

JedWatson/react-md-editor

开源软件地址(OpenSource Url):

https://github.com/JedWatson/react-md-editor

开源编程语言(OpenSource Language):

JavaScript 80.0%

开源软件介绍(OpenSource Introduction):

React Markdown Editor

A Markdown Editor for React.js, built with CodeMirror.

This is a work in progress. Format application and removal is not very robust, some formats are missing.

Demo & Examples

Live demo: JedWatson.github.io/react-md-editor

To build the examples locally, run:

npm install
npm start

Then open localhost:8000 in a browser.

Installation

The easiest way to use codemirror is to install it from NPM and include it in your own React build process (using Browserify, Webpack, etc).

You can also use the standalone build by including dist/codemirror.js in your page. If you use this, make sure you have already included React, and it is available as a global variable.

npm install codemirror --save

Usage

var React = require('react'),
	Editor = require('react-md-editor');

var App = React.createClass({
	getInitialState: function() {
		return {
			code: "# Markdown"
		};
	},
	updateCode: function(newCode) {
		this.setState({
			code: newCode
		});
	},
	render: function() {
		return <Editor value={this.state.code} onChange={this.updateCode} />
	}
});

React.render(<App />, document.getElementById('app'));

Properties

  • value String the markdown
  • options Object (newValue) options passed to the CodeMirror instance
  • onChange Function (newValue) called when a change is made

See the CodeMirror API Docs for the available options.

License

MIT. Copyright (c) 2016 Jed Watson.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap