设置UEditor编辑器不可编辑

<div class="form-group has-feedback">
    <label class="col-lg-2 control-label"><?php echo $LoadLanguage['_Title_Information'];?></label><!--概况-->
    <div class="col-lg-10">
        <textarea id="Information" name="Information" style="width:100%;height:200px;"><?php echo $GLOBALS['Information'];?></textarea>
        <script type="text/javascript"> 
            // 代码实例化编辑器
            var Information = UE.getEditor('Information',{
                toolbars:[
                    ['fullscreen', 'undo', 'redo', '|', 'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', '|', 'forecolor', 'backcolor', 'nsertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|', 'rowspacingtop', 'rowspacingbottom', 'lineheight', '|', 'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|', 'directionalityltr', 'directionalityrtl', 'indent', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|', 'print', 'preview']
                    ]
                });
                Information.ready(function() {
                // 设置UEditor编辑器不可编辑
                Information.setDisabled();
            });
        </script>
    </div>
</div>

  • 7
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要禁止vue-ueditor-wrap编辑,可以通过设置contentEditable属性为false来实现。在给定的引用和引用中,可以看到两种实现方法。 方法一:在ready方法中设置contentEditable属性为false 在引用中的isEditUeditor函数中,可以看到以下代码片段: ``` document.getElementById('ueditor_0').contentWindow.document.getElementsByTagName('body')[0].contentEditable = false; ``` 这行代码将body元素的contentEditable属性设置为false,从而禁止编辑。 方法二:在ready方法中使用editor实例的setDisabled方法 在引用中的ready方法中,可以看到以下代码片段: ``` this.$refs.ueditor_v.editor.body.contentEditable = false; ``` 这行代码将editor实例的body元素的contentEditable属性设置为false,从而禁止编辑。 所以,如果想要禁止vue-ueditor-wrap编辑,你可以选择其中一种方法来实现。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [vue项目:集成富文本编辑器 - 百度ueditor(vue-ueditor-wrap)](https://blog.csdn.net/snowball_li/article/details/122170339)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] - *3* [vue 使用 ueditor 编辑器设置不可编辑和可编辑,笔记,补充打开右键功能](https://blog.csdn.net/cscscssjsp/article/details/103909461)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值