<template>
  <div
    :style="`width:${width}px`"
    class="flex flex-center mr-10 mt-5 font-12 main pointer"
  >
    <el-icon v-if="type === '1'" class="mr-5" color="#E9A956">
      <component :is="icon"></component>
    </el-icon>
    <div class="nowrap bold" style="color: #707070">{{ title }}</div>
  </div>
</template>

<script>
export default {
  name: 'main-button',
  props: {
    title: {
      type: String,
      default: '项目详情'
    },
    type: {
      type: String,
      default: '1'
    },
    icon: {
      type: String,
      default: ''
    },
    width: {
      type: Number,
      default: 100
    }
  },
  methods: {
    click() {
      this.$emit('click')
    }
  }
}
</script>

<style lang="scss" scoped>
.main {
  border-radius: 20px;
  border: 1px solid #ab7630;
  color: #ecab56;
  height: 32px;
  line-height: 34px;
}
</style>
