<style lang="less">
.button-wrap {
  margin: 0 auto;
  width: 480rpx;
  height: 112rpx;
  line-height: 112rpx;
  background: #ffda1a;
  box-shadow: 0px 4px 12px rgba(255, 218, 26, 0.3);
  border-radius: 40rpx;
  text-align: center;
  font-weight: 500;
  font-size: 32rpx;
  color: rgba(13, 13, 61, 0.86);
  .icon {
    margin-right: 16rpx;
    width: 28rpx;
    height: 28rpx;
    vertical-align: middle;
  }
  .text {
    vertical-align: middle;
  }
}
</style>

<template>
  <div class="button-wrap" v-on:click="submit">
    <image class="icon" v-if="icon" src="{{icon}}" />
    <span class="text" v-if="text">{{ text }}</span>
  </div>
</template>

<script>
import wepy from '@wepy/core';

wepy.component({
  props: {
    icon: String,
    text: String,
    clickEmitId: String,
  },
  ready() {},
  methods: {
    submit() {
      if (this.clickEmitId) {
        this.$emit(this.clickEmitId);
      }
    },
  },
});
</script>
