提交 aa93d94e 编写于 作者: 璃白.'s avatar 璃白. 🌻

Update README.md

上级 95dde5e4
# About
一款Markdown编辑器组件,支持使用markodwn语法来编写文档,同时支持图片上传等功能
# 使用
1. 通过script标签引入
```html
<script src="./markdown-editor.js"></script>
```
2. 指定需要渲染的容易
```html
<div id="app"></div>
```
3. 初始化实例
```js
new MdEditor({
...options
})
``` ```
npm install
npm start # options
<div id="app"></div> | 属性 | 说明 | 类型 | 默认值 |
<script src="./bundle.js"></script> | ------ | ------ | ------ | ------ |
<script> | el | 编辑器渲染的容器 | String | "#app"
new MdEditor({ | themeOptions | 主题颜色配置 | Object | [themeOptions](#themeOptions)
el: "#app" | canAttachFile | 是否可以上传图片 | Boolean | true
}); | placeholder | placeholder | String | "请输入内容"
</script> | onChange | 获取编辑器内容 | Function | function(res) {}
| onUpload | 上传文件钩子函数 | Function | function(file, callback) {}
```
\ No newline at end of file # themeOptions
| 属性 | 说明 | 类型 | 默认值 |
| ------ | ------ | ------ | ------ |
| borderColor | 编辑器边框默认颜色 | String | "#dbdbdb"
| borderColorActive | 编辑器边框激活颜色 | String | "#409eff"
| textColor | 编辑器文字默认颜色 | String | "#303030"
| textColorActive | 编辑器文字激活颜色 | String | "#000"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册