> 开箱即用的小程序图文编辑组件
## 代码片段
[https://developers.weixin.qq.com/s/adp5u9mk7H6w](https://developers.weixin.qq.com/s/adp5u9mk7H6w)
## 效果预览

## 组件属性
属性名|类型|默认值|说明
---|---|---|---
image-upload-url|String|无|图片上传,必填,参考[wx.uploadFile](https://developers.weixin.qq.com/miniprogram/dev/api/network-file.html#wxuploadfileobject)
image-upload-name|String|无|图片上传,必填,参考[wx.uploadFile](https://developers.weixin.qq.com/miniprogram/dev/api/network-file.html#wxuploadfileobject)
image-upload-header|String|无|图片上传,参考[wx.uploadFile](https://developers.weixin.qq.com/miniprogram/dev/api/network-file.html#wxuploadfileobject)
image-upload-form-data|Object|无|图片上传,参考[wx.uploadFile](https://developers.weixin.qq.com/miniprogram/dev/api/network-file.html#wxuploadfileobject)
image-upload-key-chain|String|无|图片上传接口返回值中url字段的路径,如返回为`{ image : { url: 'http://xxx.jpg' } }`,则填`image.url`
output-type|String|html|输出的格式,`html`或`array`,参考[rich-text](https://developers.weixin.qq.com/miniprogram/dev/component/rich-text.html)
button-background-color|String|#409EFF|完成按钮的背景色
button-text-color|String|#fff|完成按钮的前景色
nodes|Array|无|初始内容的array形式,仅支持此组件输出的array,优先于HTML
html|String|无|初始内容的HTML形式,仅支持此组件输出的HTML
bindfinish|EventHandle|无|输出内容时触发,`event.detail = { content }`
## 代码示例
```xml
<!-- index.wxml -->
<xing-editor
bindfinish="finish"
output-type="html"
image-upload-url="http://localhost:3000/upload"
image-upload-name="image"
image-upload-key-chain="image.url"
html="{{html}}"/>
```
```javascript
//index.js
Page({
data: {
html: '<p class="xing-p">123124<br><br>123124123<br><br><br>324123</p>' +
'<img class="xing-img" style="width: 100%" src="http://localhost:3000/static/73e95bd90f005.png" _height="0.5743348982785602" _uploaded="true"></img>' +
'<p class="xing-p">333</p>' +
'<img class="xing-img" style="width: 100%" src="http://localhost:3000/static/2dab4bd82f879.png" _height="1.2095588235294117" _uploaded="true"></img>',
},
finish: function (e) {
console.log(e.detail.content);
},
})
```
```javascript
{
"usingComponents": {
"xing-editor": "/components/xing-editor"
}
}
```
## TODO List
- □ 文字格式编辑
- □ 图片免上传(转Base64存储)
- □ 编辑预览

葡萄籽儿
- 粉丝: 1040
最新资源
- 国际工程的项目管理模式(1).docx
- 计算机与智能教育学院.docx
- 2023年全国计算机二级考试公共基础知识题库及答案.doc
- 微软公司招聘过程及经验.pptx
- 较好的人工智能PPT(PPT34页).ppt
- 国家开放大学电大《网络应用服务管理》机考第一套真题题库及答案.docx
- 维九度网络推广方案.pdf
- 基于单片机的智能家居防火防盗报警系统-毕业设计.doc
- 网络小说对中学生影响的调查报告.docx
- 项目管理惩罚条例.doc
- 网络营销之二外部优化的大方法.pptx
- 高端商务写字楼项目管理标准化情况汇报(11页-图文丰富).ppt
- 电子商务进农村解决方案.doc
- 高校后勤会计信息化的建构【精品发布】.doc
- 阳光公司网络系统规划设计实习报告.pdf
- 中国电信无线网络应急指导手册.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


