CButton.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <button class="c-button" @click="$emit('click')">
  3. <span v-if="icon" class="icon">{{icon}}</span>
  4. <slot></slot>
  5. </button>
  6. </template>
  7. <script>
  8. export default {
  9. props: ['icon']
  10. }
  11. </script>
  12. <style lang="scss" scoped>
  13. @import '~@/style/theme.scss';
  14. button {
  15. border: none;
  16. outline: none;
  17. background: transparent;
  18. cursor: pointer;
  19. -webkit-tap-highlight-color: transparent;
  20. display: block;
  21. min-width: 120px;
  22. height: 40px;
  23. background: $theme-blue;
  24. color: white;
  25. border-radius: 8px;
  26. font-size: 14px;
  27. padding: 0 16px;
  28. font-weight: 600;
  29. &:hover {
  30. background: darken($theme-blue, 5);
  31. }
  32. &:active {
  33. background: darken($theme-blue, 10);
  34. }
  35. }
  36. .secondary {
  37. color: $theme-blue;
  38. background: $theme-blue-transparent;
  39. &:hover {
  40. background: darken($theme-blue-transparent, 5);
  41. }
  42. &:active {
  43. background: darken($theme-blue-transparent, 10);
  44. }
  45. }
  46. .warning {
  47. color: $theme-orange;
  48. background: $theme-orange-transparent;
  49. &:hover {
  50. background: darken($theme-orange-transparent, 5);
  51. }
  52. &:active {
  53. background: darken($theme-orange-transparent, 10);
  54. }
  55. }
  56. .error {
  57. color: $theme-red;
  58. background: $theme-red-transparent;
  59. &:hover {
  60. background: darken($theme-red-transparent, 5);
  61. }
  62. &:active {
  63. background: darken($theme-red-transparent, 10);
  64. }
  65. }
  66. </style>