未验证 提交 3a22dca5 编写于 作者: 折腾笔记 提交者: GitHub

Update editor.md

上级 b9a77ba4
......@@ -63,6 +63,7 @@ editor组件目前只有H5、App的vue页面、微信小程序、百度小程序
* 插入 html 到编辑器内时,编辑器会删除一些不必要的标签,以保证内容的统一。例如`<p><span>xxx</span></p>`会改写为`<p>xxx</p>`
* 编辑器聚焦时页面会被上推,系统行为以保证编辑区可见
* H5端会动态引入依赖 [quill.min.js](https://unpkg.com/quill@1.3.7/dist/quill.min.js)、[image-resize.min.js](https://unpkg.com/quill-image-resize-mp@3.0.1/image-resize.min.js),依赖从 [unpkg.com](https://unpkg.com) 加载,如过依赖加载较慢,可以下载下来放在自己的服务器或 CDN 服务商,然后在 [自定义模板](/collocation/manifest?id=h5-template) head 内引入。
* 不能直接插入视频,编辑时可以采用视频封面占位,并在图片属性中保存视频信息,预览时再还原为视频。
**示例代码** [查看演示](https://hellouniapp.dcloud.net.cn/pages/component/editor/editor)
......@@ -83,16 +84,16 @@ editor组件目前只有H5、App的vue页面、微信小程序、百度小程序
}
},
methods: {
onEditorReady() {
// #ifdef MP-BAIDU
this.editorCtx = requireDynamicLib('editorLib').createEditorContext('editorId');
// #endif
// #ifdef APP-PLUS || H5 ||MP-WEIXIN
uni.createSelectorQuery().select('#editor').context((res) => {
this.editorCtx = res.context
}).exec()
// #endif
onEditorReady() {
// #ifdef MP-BAIDU
this.editorCtx = requireDynamicLib('editorLib').createEditorContext('editorId');
// #endif
// #ifdef APP-PLUS || H5 ||MP-WEIXIN
uni.createSelectorQuery().select('#editor').context((res) => {
this.editorCtx = res.context
}).exec()
// #endif
},
undo() {
this.editorCtx.undo()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册