man*_*anx 3 quill angular ngx-quill
我正在使用ngx-quill编辑器,到目前为止它具有我需要的所有功能。但是,我没有看到有关如何删除来自剪贴板的文本的背景颜色和字体颜色的任何选项。
我想保留除颜色之外的所有其他格式。这可能吗?
对于与我有同样问题的任何人,我设法找到了解决方法。
在我看来:
<quill-editor (onEditorCreated)='editorInit($event)'></quill-editor>
Run Code Online (Sandbox Code Playgroud)
在我的控制器上
editorInit(quill: any){
quill.clipboard.addMatcher(Node.ELEMENT_NODE, function(node, delta){
delta.forEach(e => {
if(e.attributes){
e.attributes.color = '';
e.attributes.background = '';
}
});
return delta;
});
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1053 次 |
| 最近记录: |