u-button.vue 563 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <tui-button
  3. width="128rpx"
  4. height="48rpx"
  5. type="base"
  6. shape="circle"
  7. :size="24"
  8. :plain="plain"
  9. @click="$emit('click')"
  10. >
  11. {{btnText}}
  12. </tui-button>
  13. </template>
  14. <script>
  15. export default {
  16. name: 'u-button',
  17. props: {
  18. plain: {
  19. type: Boolean,
  20. defalut: false
  21. },
  22. controlType: {
  23. typs: String,
  24. default: 'receive'
  25. }
  26. },
  27. computed: {
  28. btnText() {
  29. const textMap = {
  30. receive: '领取',
  31. use: '使用',
  32. buy: '凑单',
  33. search: '可用商品'
  34. }
  35. return textMap[this.controlType] || ''
  36. }
  37. }
  38. }
  39. </script>