floatBut.vue 1022 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view class="float-but" hover-class="navigator-hover" :style="{ 'z-index': zIndex }" @click.stop="click1">
  3. {{ text }}
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. name: "floatBut",
  9. props: {
  10. text: {
  11. type: String,
  12. default: "上传"
  13. },
  14. onClick: {
  15. type: Function
  16. },
  17. zIndex: {
  18. type: [String, Number],
  19. default: 99
  20. }
  21. },
  22. data() {
  23. return {
  24. }
  25. },
  26. methods: {
  27. click1() {
  28. this.$emit("onClick")
  29. }
  30. },
  31. }
  32. </script>
  33. <style lang="scss" scoped>
  34. .float-but {
  35. position: fixed;
  36. bottom: 120px;
  37. right: 10px;
  38. width: 56px;
  39. height: 56px;
  40. line-height: 56px;
  41. text-align: center;
  42. background: radial-gradient(100% 0% at 50% 50%, #E2041E 0%, #C30D23 100%);
  43. border-radius: 50%;
  44. font-family: Source Han Sans SC, Source Han Sans SC;
  45. font-weight: bold;
  46. font-size: 16px;
  47. color: #FFFFFF;
  48. }
  49. </style>