main-button.vue 863 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <div
  3. :style="`width:${width}px`"
  4. class="flex flex-center mr-10 mt-5 font-12 main pointer"
  5. >
  6. <el-icon v-if="type === '1'" class="mr-5" color="#E9A956">
  7. <component :is="icon"></component>
  8. </el-icon>
  9. <div class="nowrap bold" style="color: #707070">{{ title }}</div>
  10. </div>
  11. </template>
  12. <script>
  13. export default {
  14. name: 'main-button',
  15. props: {
  16. title: {
  17. type: String,
  18. default: '项目详情'
  19. },
  20. type: {
  21. type: String,
  22. default: '1'
  23. },
  24. icon: {
  25. type: String,
  26. default: ''
  27. },
  28. width: {
  29. type: Number,
  30. default: 100
  31. }
  32. },
  33. methods: {
  34. click() {
  35. this.$emit('click')
  36. }
  37. }
  38. }
  39. </script>
  40. <style lang="scss" scoped>
  41. .main {
  42. border-radius: 20px;
  43. border: 1px solid #ab7630;
  44. color: #ecab56;
  45. height: 32px;
  46. line-height: 34px;
  47. }
  48. </style>