简体   繁体   English

如何防止ckeditor在页面中加载多个content.css

[英]how to prevent ckeditor load more than one content.css in the page

I am using several instances of CKEDITOR on a single page, my problem is that each editor loads a content.css file this makes the page slower我在单个页面上使用了多个 CKEDITOR 实例,我的问题是每个编辑器都加载了一个 content.css 文件,这会使页面变慢

for example例如

<script>
CKEDITOR.config.height = 200;
CKEDITOR.config.width  = 'auto';

CKEDITOR.replace('textarearesultado{{$letras_iterator}}');
</script>

<script>
CKEDITOR.config.height = 200;
CKEDITOR.config.width  = 'auto';

CKEDITOR.replace('textareaevidencia{{$loop->index}}');
</script>

the result is结果是

在此处输入图片说明

How could I avoid this?我怎么能避免这种情况?

You can try to use replaceAll method instead of replace您可以尝试使用replaceAll方法而不是replace

https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR.html#method-replaceAll https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR.html#method-replaceAll

    <body>
    <textarea name="editor1"></textarea>
    <textarea name="editor2"></textarea>
    <textarea name="editor3"></textarea>
    <script>
        // Replace all three <textarea> elements above with CKEditor instances.
        CKEDITOR.replaceAll();
    </script>
</body>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM