show-info.vue 1006 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <view style="position: relative;">
  3. <uni-icons @mouseenter.native="mouseenter" @mouseleave.native="showStableInfo = false"
  4. style="padding:0 10px;color: #a8a8a8;cursor: pointer;" type="info" />
  5. <view v-if="showStableInfo" class="show-stable" :style="{top:`${top}px`,left:`${left}px`}">
  6. <text>{{content}}</text>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. props: {
  13. content: String,
  14. top: {
  15. type: [Number, String],
  16. default: -60
  17. },
  18. left: {
  19. type: [Number, String],
  20. default: -100
  21. }
  22. },
  23. data() {
  24. return {
  25. showStableInfo: false,
  26. arrowStyle: {}
  27. }
  28. },
  29. methods: {
  30. mouseenter(e) {
  31. this.showStableInfo = true
  32. }
  33. }
  34. }
  35. </script>
  36. <style lang="scss" scoped>
  37. $main_color: #fff;
  38. $main_back_color: #303133;
  39. .show-stable {
  40. width: 200px;
  41. position: absolute;
  42. padding: 5px 10px;
  43. background-color: $main_back_color;
  44. color: $main_color;
  45. border-radius: 4px;
  46. border: 1px solid #e9e9eb;
  47. z-index: 99999;
  48. }
  49. </style>