如何将原子包右对齐

How to align atom package to the right

我在 Atom 中有一个用 JS 创建的包,我想将它的(切换)位置设置在右边。我研究了很多,但没有关于 javascript 包的信息;所有这些都是关于 coffeescript 的。我发现了这样的东西:

# config:
#   browser:
#     type: "object"
#     properties:
#       position:
#         default: "right"
#         type: "string"
#         enum: ["top", "right", "bottom", "left"]
#       size:
#         type: "integer"
#         default: 450

我想我可以使用 atom.config.set(keyPath, value, options),但我无法配置它。

Javascript 中 Atom 包的等价物是:

config: {
  browser: {
    type: 'object',
    properties: {
      position: {
        default: 'right',
        type: 'string',
        enum: ['top', 'right', 'bottom', 'left'],
      },
      size: {
        type: 'integer',
        default: 450,
      }
    }
  }
}

我建议将其与其他配置选项一起放在代码顶部或附近。

我想要的解决方案 -> 在 your_package_name.js 中:

改变

this.modalPanel = atom.workspace.addModalPanel

this.modalPanel = atom.workspace.addRightPanel