为ckeditor换皮 [英] Changing skin for ckeditor

查看:130
本文介绍了为ckeditor换皮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能换皮肤吗?我正在创建具有浅色和深色主题的有角度的应用程序.我准备了两个ckeditor皮肤.但是,即使我销毁了ck实例,下一个实例也具有之前的外观-不是当前的外观.

Am I able to change skin? I'm creating angular app, that has light and dark theme. I have prepared two ckeditor skins. But even if I destroy ck instance, next instance has previuos skin - not current.

推荐答案

CKEditor4外观应用于实例创建,因此重新创建实例是动态更新编辑器外观的好方法.您应该可以通过配置选项 config.skin 当用编辑器替换DOM元素以指示其外观时,例如:

CKEditor4 skins are applied to instance creation, so recreating instance is a good way to dynamically update editor skin. You should be able to pass configuration option config.skin when replacing DOM element with an editor to indicate its skin e.g:

CKEDITOR.replace( 'editor', {
  skin: 'moono'
} );

请注意,自定义皮肤应放置在 skins 文件夹中,或者您应传递有关位置的其他信息,例如

Note that custom skin should be placed in skins folder or you should pass additional information about location, e.g.

config.skin = 'myskin,/customstuff/myskin/';

如果您仍然难以设置自定义外观,请分享您当前的实现.

If you still struggle with setting custom skin, please share your current implementation.

这篇关于为ckeditor换皮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆