You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

63 lines
1.0 KiB

  1. <template>
  2. <button
  3. @click="click"
  4. :class="[
  5. size,
  6. round ? 'round' : '',
  7. shadow ? 'shadow' : '',
  8. buttonColor,
  9. buttonBorder,
  10. block ? 'block' : '',
  11. disabled ? 'disabled' : '',
  12. className
  13. ]"
  14. :disabled="disabled ? 'disabled' : null"
  15. :type="disabled && line ? 'default' : null"
  16. :style="style"
  17. hover-class="button-hover"
  18. class="cu-btn"
  19. >
  20. <slot></slot>
  21. </button>
  22. </template>
  23. <script>
  24. export default {
  25. name: 'l-button',
  26. props: {
  27. size: { default: 'df' },
  28. color: {},
  29. round: {},
  30. shadow: {},
  31. line: {},
  32. blod: {},
  33. icon: {},
  34. disabled: {},
  35. block: {}
  36. },
  37. computed: {
  38. buttonBorder() {
  39. return this.line ? `line${this.blod ? 's' : ''}-${this.line || 'gray'}` : ''
  40. },
  41. buttonColor() {
  42. if (this.color) {
  43. return `bg-${this.color}`
  44. } else if (!this.line) {
  45. return `bg-gray`
  46. }
  47. return ''
  48. }
  49. },
  50. methods: {
  51. click(e) {
  52. this.$emit('click', e)
  53. }
  54. }
  55. }
  56. </script>