button.js 651 字节
// components/button.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    text: {
      type: String,
      value: '',
    },
    type: {
      type: String,
      value: 'normal',
    },
    plain: {
      type: Boolean,
      value: false,
    },
    disabled: {
      type: Boolean,
      value: false,
    }
  },
  /**
   * 暴露class
   */
  externalClasses: ['lx-class'],

  /**
   * 组件的初始数据
   */
  data: {
    typeMap: {
      normal: 'orange-theme',
      success: 'green-theme',
      primary: 'blue-theme',
      danger: 'red-theme'
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {

  }
})