Skip to content

Commit 24f935f

Browse files
增加vue和react的文档和demo
1 parent 9ea56b9 commit 24f935f

40 files changed

+995
-5
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
- 直接下载:[https://github.com/wangfupeng1988/wangEditor/releases](https://github.com/wangfupeng1988/wangEditor/releases)
1919
- 使用`npm`下载:`npm install wangeditor` (注意 `wangeditor` 全部是**小写字母**
2020
- 使用`bower`下载:`bower install wangEditor` (前提保证电脑已安装了`bower`
21-
- 使用CDN:[www.bootcdn.cn/wangeditor](http://www.bootcdn.cn/wangeditor/)
21+
- 使用CDN:[//unpkg.com/wangeditor@3.0.0/release/wangEditor.min.js](https://unpkg.com/wangeditor@3.0.0/release/wangEditor.min.js)(其中`@3.0.0`代表了`npm`中发布的版本)
2222

2323

2424
## 使用
@@ -37,6 +37,7 @@ editor2.create()
3737
- 进入目录,安装依赖包 `cd wangEditor && npm i`
3838
- 安装包完成之后,windows 用户运行`npm run win-example`,Mac 用户运行`npm run example`
3939
- 打开浏览器访问[localhost:3000/index.html](http://localhost:3000/index.html)
40+
- 用于 React 或者 vue 可查阅[文档](http://www.kancloud.cn/wangfupeng/wangeditor3/332599)中“其他”章节中的相关介绍
4041

4142
## 交流
4243

docs/dev/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
上线
1818

19-
- 修改`package.json`版本
19+
- 修改`package.json`版本,修改 unpkg 链接中的版本
2020
- 提交到github,并创建tag
2121
- 提交到 npm
2222
- 同步到官网

docs/usage/01-getstart/01-demo.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<script type="text/javascript">
3434
var E = window.wangEditor
3535
var editor = new E('#editor')
36+
// 或者 var editor = new E( document.getElementById('#editor') )
3637
editor.create()
3738
</script>
3839
</body>

docs/usage/01-getstart/03-sperate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<script type="text/javascript" src="/wangEditor.min.js"></script>
3232
<script type="text/javascript">
3333
var E = window.wangEditor
34-
var editor1 = new E('#div1', '#div2')
34+
var editor1 = new E('#div1', '#div2') // 两个参数也可以传入 elem 对象,class 选择器
3535
editor1.create()
3636
</script>
3737
</body>

docs/usage/05-other/05-react.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
# 用于 React
1+
# 用于 React
2+
3+
如果需要将 wangEditor 用于 React 中,可参见如下示例
4+
5+
- 下载源码 `git clone git@github.com:wangfupeng1988/wangEditor.git`
6+
- 进入 React 示例目录 `cd wangEditor/example/demo/in-react/`,查看`src/App.js`即可
7+
- 也可以运行`npm install && npm start`查看在 React 中的效果(`http://localhost:3000/`

docs/usage/05-other/06-vue.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
# 用于 Vue
1+
# 用于 Vue
2+
3+
如果需要将 wangEditor 用于 Vue 中,可参见如下示例
4+
5+
- 下载源码 `git clone git@github.com:wangfupeng1988/wangEditor.git`
6+
- 进入 vue 示例目录 `cd wangEditor/example/demo/in-vue/`,查看`src/App.js`即可
7+
- 也可以运行`npm install && npm run dev`查看在 vue 中的效果(`http://localhost:8080/`

example/demo/in-react/package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "wangeditor-in-react",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"react": "^15.5.4",
7+
"react-dom": "^15.5.4",
8+
"wangeditor": "^3.0.0"
9+
},
10+
"devDependencies": {
11+
"react-scripts": "1.0.7"
12+
},
13+
"scripts": {
14+
"start": "react-scripts start",
15+
"build": "react-scripts build",
16+
"test": "react-scripts test --env=jsdom",
17+
"eject": "react-scripts eject"
18+
}
19+
}
24.3 KB
Binary file not shown.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6+
<meta name="theme-color" content="#000000">
7+
<!--
8+
manifest.json provides metadata used when your web app is added to the
9+
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
10+
-->
11+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
12+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
13+
<!--
14+
Notice the use of %PUBLIC_URL% in the tags above.
15+
It will be replaced with the URL of the `public` folder during the build.
16+
Only files inside the `public` folder can be referenced from the HTML.
17+
18+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
19+
work correctly both with client-side routing and a non-root public URL.
20+
Learn how to configure a non-root public URL by running `npm run build`.
21+
-->
22+
<title>React App</title>
23+
</head>
24+
<body>
25+
<noscript>
26+
You need to enable JavaScript to run this app.
27+
</noscript>
28+
<div id="root"></div>
29+
<!--
30+
This HTML file is a template.
31+
If you open it directly in the browser, you will see an empty page.
32+
33+
You can add webfonts, meta tags, or analytics to this file.
34+
The build step will place the bundled scripts into the <body> tag.
35+
36+
To begin the development, run `npm start` or `yarn start`.
37+
To create a production bundle, use `npm run build` or `yarn build`.
38+
-->
39+
</body>
40+
</html>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"short_name": "React App",
3+
"name": "Create React App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "192x192",
8+
"type": "image/png"
9+
}
10+
],
11+
"start_url": "./index.html",
12+
"display": "standalone",
13+
"theme_color": "#000000",
14+
"background_color": "#ffffff"
15+
}

0 commit comments

Comments
 (0)