社区
JavaScript
帖子详情
ueditor setContent html
小点灬
2017-07-12 03:05:40
请教一下各位大神们!
先把ueditor编辑器里面的html源码都存到数据库了,然后在修改的时候,取出来的数据也是没问题,可是用setContent把数据放到编辑器里面修改的时候,video的标签会变成img标签,造成数据不对!请问有遇到过这个问题的吗?
...全文
643
8
打赏
收藏
ueditor setContent html
请教一下各位大神们! 先把ueditor编辑器里面的html源码都存到数据库了,然后在修改的时候,取出来的数据也是没问题,可是用setContent把数据放到编辑器里面修改的时候,video的标签会变成img标签,造成数据不对!请问有遇到过这个问题的吗?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
8 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
欣欣果果
2017-09-01
打赏
举报
回复
引用 3 楼 sunshine_myPG 的回复:
已经解决啦!把源码改一下就可以!
请问怎么改的源码,改的哪里呢?
小点灬
2017-09-01
打赏
举报
回复
function creatInsertStr(url,width,height,id,align,classname,type,title,original){ //debugger url = utils.unhtmlForUrl(url); align = utils.unhtml(align); classname = utils.unhtml(classname); width = parseInt(width, 10) || 0; height = parseInt(height, 10) || 0; var str; switch (type){ case 'image': str = '<video ' + (id ? 'id="' + id+'"' : '') + ' _original="'+type+'" width="'+ width +'" height="' + height + '" _url="'+url+'" class="' + classname.replace(/\bvideo-js\b/, '') + '"' + ' src="'+url+'" controls="controls" style="background: #000;"></video><br>' //debugger break; case 'embed': str = '<embed type="application/x-shockwave-flash" class="' + classname + '" pluginspage="http://www.macromedia.com/go/getflashplayer"' + ' src="' + utils.html(url) + '" width="' + width + '" height="' + height + '"' + (align ? ' style="float:' + align + '"': '') + ' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >'; break; case 'video': var ext = url.substr(url.lastIndexOf('.') + 1); if(ext == 'ogv') ext = 'ogg'; str = '<video' + (id ? ' id="' + id + '"' : '') + ' class="' + classname + ' video-js" ' + (align ? ' style="float:' + align + '"': '') + ' controls preload="none" width="' + width + '" height="' + height + '" src="' + url + '" data-setup="{}">' + '<source src="' + url + '" type="video/' + ext + '" /></video>'; break; } return str; }
小点灬
2017-09-01
打赏
举报
回复
欣欣果果
2017-08-23
打赏
举报
回复
请问怎么解决的,现在就在被这个问题困扰着,能否告知一下,我qq:377356945
qq_39652884
2017-08-04
打赏
举报
回复
<div>试试</div>
小点灬
2017-07-12
打赏
举报
回复
已经解决啦!把源码改一下就可以!
xwn_2016
2017-07-12
打赏
举报
回复
直接放进去是不是又多添加了一层p标签
world_broken
2017-07-12
打赏
举报
回复
坑多。看到源码中一堆的P,不晕么? 分栏,嵌套,分段,背景。。。都存在问题。
vue-
ueditor
-wrap的
ueditor
此外,vue-
ueditor
-wrap还提供了许多实用的方法和属性,如`this.$refs.
ueditor
.get
Content
()`用于获取编辑器中的内容,`this.$refs.
ueditor
.
set
Content
('新内容')`用于设置编辑器内容,以及`this.$refs.
ueditor
.get_...
ueditor
使用说明文档
UEditor
提供了 get
Content
和
set
Content
方法来设置和读取编辑器的内容。例如: ```javascript var ue = UE.get
Content
(); ue.ready(function() { // 设置编辑器的内容 ue.
set
Content
('hello'); // 获取
html
...
ueditor
组件
例如,`get
Content
()`用于获取编辑器内的
HTML
内容,`
set
Content
()`用于设置编辑器内容,`execCommand()`执行各种编辑命令,如加粗、斜体等。 5. **优化与安全** 考虑到性能和安全性,开发者需要对
ueditor
进行适当...
vue集成
ueditor
.zip
ueditor
.
set
Content
('欢迎使用
UEditor
'); }); }, }, }; ``` ### 3. 图片上传处理
UEditor
支持自定义图片上传处理,需要在`editorConfig`中设置`imageUrl`属性指向图片上传的接口。这个接口通常是一个后端API...
vue 百度编辑器
ueditor
使用文件
that.editor.
set
Content
(that.editor
Content
) // 如果有初始内容,可以设置 that.editor.addListener('
content
Change', () => { that.editor
Content
= that.editor.get
Content
() }) }) }, beforeDestroy() { ...
JavaScript
87,993
社区成员
224,689
社区内容
发帖
与我相关
我的任务
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
分享
社区描述
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章