index.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view class="u-flex-col buttom-btn-left-inner" @click.stop="handleClick"
  3. :class="btnType === 'reject' ? 'reject' : ''">
  4. <u-icon v-if="customIcon" :name="iconName" :size="size" :custom-prefix="btnIcon"></u-icon>
  5. <u-icon v-else :name="iconName" :size="size"></u-icon>
  6. <text>{{btnText}}</text>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. props: {
  12. btnLoading: {
  13. type: Boolean,
  14. default: false
  15. },
  16. customIcon: {
  17. type: Boolean,
  18. default: false
  19. },
  20. btnText: {
  21. type: String,
  22. default: ''
  23. },
  24. btnIcon: {
  25. type: String,
  26. default: 'icon-ym icon-ym-add-cancel'
  27. },
  28. btnType: {
  29. type: String,
  30. default: 'cancel'
  31. },
  32. iconName: {
  33. type: String,
  34. default: 'icon-ym'
  35. },
  36. size: {
  37. type: [Number, String],
  38. default: 24
  39. }
  40. },
  41. methods: {
  42. handleClick() {
  43. if (this.btnType === 'cancel') return this.jnpf.goBack()
  44. if (this.btnType === 'more') return this.$emit('handleBtn', this.btnLoading ? false : true)
  45. if (this.btnType === 'save' || this.btnType === 'reject') return this.$emit('handleBtn')
  46. }
  47. }
  48. }
  49. </script>
  50. <style>
  51. </style>