my-fixed-button.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <u-button
  3. @click="click"
  4. :type="type"
  5. :size="size"
  6. :custom-style="{
  7. borderRadius: 0
  8. }"
  9. style="border-radius: 0;"
  10. :style="{
  11. width: width,
  12. fontSize: fontSize,
  13. position: position,
  14. bottom: bottom,
  15. left: left
  16. }">
  17. {{ text }}
  18. </u-button>
  19. </template>
  20. <script>
  21. export default {
  22. data() {
  23. return {
  24. };
  25. },
  26. methods:{
  27. click() {
  28. if(this.customClick) {
  29. this.$emit('click')
  30. } else {
  31. this.$utils.openReLaunch('/pages/index/index')
  32. }
  33. }
  34. },
  35. props: {
  36. // 自定义点击事件
  37. customClick: {
  38. type: Boolean,
  39. default: false
  40. },
  41. text: {
  42. type: String,
  43. default: '返回首页'
  44. },
  45. size: {
  46. type: String,
  47. default: 'default'
  48. },
  49. type: {
  50. type: String,
  51. default: 'primary'
  52. },
  53. width: {
  54. type: String,
  55. default: '100%'
  56. },
  57. height: {
  58. type: String,
  59. default: '60rpx'
  60. },
  61. fontSize: {
  62. type: String,
  63. default: '24rpx'
  64. },
  65. position: {
  66. type: String,
  67. default: 'fixed'
  68. },
  69. bottom: {
  70. type: String,
  71. default: '0'
  72. },
  73. left: {
  74. type: String,
  75. default: '0'
  76. }
  77. }
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. .u-btn {
  82. }
  83. </style>