首页 文章

CKEditor Link插件为渲染元素添加样式

提问于
浏览
0

我试图将以下属性添加到我在链接插件对话框中单击确定后创建的元素

style="color:#1cb9b0"

不确定我将在onOk函数中添加属性的位置?那是目前的

onOk: function () {
            var data = {};

            // Collect data from fields.
            this.commitContent(data);

            if (!this._.selectedElements.length) {
                insertLinksIntoSelection(editor, data);
            } else {
                editLinksInSelection(editor, this._.selectedElements, data);

                delete this._.selectedElements;
            }
        },

任何提示或提示都会很棒 .

1 回答

  • 0

    因此,建议在插入或编辑现有链接时,我可以在那里添加样式属性 .

    insertLinksIntoSelectioneditLinksInSelection 函数中,我添加了以下行

    attributes.set.style = "color: #1cb9b0;"; // add style attribute
    

    工作得很完美 .

相关问题