FormButton.vue 846 Bytes
<template>
  <lay-button :style="{'background' : buttonColor, color: buttonTextColor, border: buttonColor === '#FFFFFF' ? '1px solid #dcdfe6' : 'none'}" @click.stop="buttonClick" @click="buttonReturn">
    {{ buttonText || '无' }}
  </lay-button>
</template>

<script>
export default {
  name: 'FormButton',
  props: {
    buttonText: {
      type: String
    },
    buttonColor: {
      type: String,
      default: '#009688'
    },
    buttonTextColor: {
      type: String,
      default: '#FFFFFF'
    },
    configField: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  data() {
    return {

    }
  },
  methods: {
    buttonClick() {
      this.$emit('buttonClick', this.configField)
    },
    buttonReturn() {
      this.$emit('butClick', this.configField)
    }
  }
}
</script>

<style scoped>

</style>