将组件设置插入样式管理器

时间:2018-12-17 16:05:58

标签: javascript html css angularjs grapesjs

由于缺少文档,我很难弄清楚如何像在演示中一样向“样式管理器”面板部分添加组件设置(特征)。

是否存在代码块?我花了2天的时间试图解决这个问题,但找不到任何东西

styleManager: {

    sectors: [
       {
        name: "General",
        open: !1,
        buildProps: ["float", "display", "position", "top", "right", "left", "bottom"]
    }, {
        name: "Dimension",
        open: !1,
        buildProps: ["width", "height", "max-width", "min-height", "margin", "padding"]
    },

我想在样式管理器中添加组件设置

1 个答案:

答案 0 :(得分:0)

以下是如何将称为“垂直对齐”的功能添加到样式管理器的示例:

var StyleManager = editor.StyleManager;
StyleManager.addProperty("Typography", {
    name: "Vertical Align",
    property: "vertical-align",
    type: "select",
    default: "auto",
    list: [{
            value: "auto",
            name: "auto"
        }, {
            value: "top !important",
            name: "top"
        },
        {
            value: "middle !important",
            name: "middle"
        },
        {
            value: "bottom !important",
            name: "bottom"
        }
    ]
});