Skip to content

组件描述

子凡 edited this page Jul 5, 2019 · 2 revisions

组件描述

描述组件 props、events、actions信息。

举例

config.js

const props = [
  {
    key: "href",
    type: "string",
    info: "链接指向的页面的 URL",
    defaultValue: "javascript:;"
  },
  {
    key: "target",
    type: "string",
    info: "打开链接文档方式",
    defaultValue: "_self",
    enum: [
      {
        text: "_self",
        value: "_self"
      },
      {
        text: "_blank",
        value: "_blank"
      },
      {
        text: "_parent",
        value: "_parent"
      },
      {
        text: "_top",
        value: "_top"
      }
    ]
  }
];

const events = [];

const actions = [
  {
    key: "click",
    type: "string",
    info: "点击按钮",
    defaultValue: undefined
  }
];

export default {
  props,
  events,
  actions
};

propstype 字段决定了在平台上设置属性值的组件类型。举例:

  • type: "string" -> Input
  • type: "boolean" -> Switch

支持的属性

支持的属性

Clone this wiki locally