3

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

是否存在代码块?我花了 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"]
    },

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

4

1 回答 1

1

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

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"
        }
    ]
});
于 2019-01-04T18:32:23.143 回答