button.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <script>
  2. export default {
  3. name: "LemonButton",
  4. props: {
  5. disabled: Boolean
  6. },
  7. render() {
  8. return (
  9. <button
  10. class="lemon-button"
  11. disabled={this.disabled}
  12. type="button"
  13. on-click={this._handleClick}
  14. >
  15. {this.$slots.default}
  16. </button>
  17. );
  18. },
  19. methods: {
  20. _handleClick(e) {
  21. this.$emit("click", e);
  22. }
  23. }
  24. };
  25. </script>
  26. <style lang="stylus">
  27. @import '~styles/utils/index'
  28. +b(lemon-button)
  29. outline none
  30. line-height 1.499
  31. display inline-block
  32. font-weight 400
  33. text-align center
  34. touch-action manipulation
  35. cursor pointer
  36. background-image none
  37. border 1px solid #ddd
  38. box-sizing border-box
  39. white-space nowrap
  40. padding 0 15px
  41. font-size 14px
  42. border-radius 4px
  43. height 32px
  44. user-select none
  45. transition all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1)
  46. color rgba(0, 0, 0, 0.65)
  47. background-color #fff
  48. box-shadow 0 2px 0 rgba(0, 0, 0, 0.015)
  49. text-shadow 0 -1px 0 rgba(0, 0, 0, 0.12)
  50. &:hover:not([disabled])
  51. border-color #666
  52. color #333
  53. &:active
  54. background-color #ddd
  55. &[disabled]
  56. cursor not-allowed
  57. color #aaa
  58. background #eee
  59. </style>