<template>
  <button
    class="weui_btn"
    :class="classes"
    :disabled="disabled"
    @click="onClick"
  >
    {{ text }}
    <slot />
  </button>
</template>
<script>
export default {
  props: {
    type: {
      type: String,
      default: 'default'
    },
    disabled: Boolean,
    mini: Boolean,
    plain: Boolean,
    text: String,
    cssClasses: String
  },
  computed: {
    classes() {
      return [{
        weui_btn_disabled: this.disabled,
        weui_btn_mini: this.mini
      },
      `weui_btn_${this.type}`,
      this.plain ? `weui_btn_plain_${this.type}` : '',
      this.cssClasses
      ]
    }
  },
  methods: {
    onClick() {
      this.$emit('click')
    }
  }
}
</script>
