PopupOper.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="popup" :class="'popup-'+ point" v-if="optionShow">
  3. <view class="pop_content " @click="operate(item.type)" v-for="(item,index) in operationList" :key="index">
  4. <!-- <view class="ziyuan" v-if="index==0">
  5. <span class="iconfont icon-shangjiantou"></span>
  6. </view> -->
  7. <view class="ziyuan" :class="'ziyuan-' + point" v-if="index==0 && point== 'top'"></view>
  8. <text v-if="item.class" class="icon" :class="item.class"></text>
  9. <text class="title" v-text="item.title"></text>
  10. <view class="ziyuan" :class="'ziyuan-' + point" v-if="index==operationList.length-1 && point== 'bottom'"></view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. props: {
  17. optionShow: {
  18. type: Boolean,
  19. },
  20. operationList:{
  21. type: Array,
  22. },
  23. point: {
  24. type: String,
  25. default: 'top'
  26. }
  27. },
  28. methods: {
  29. operate(type) {
  30. this.$emit("operate", type)
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang="scss" scoped>
  36. .popup {
  37. border-radius: 12rpx;
  38. background-color: #555555;
  39. width: 160rpx;
  40. z-index: 99999;
  41. }
  42. .popup-top{
  43. position: fixed;
  44. right: 20rpx;
  45. }
  46. .popup-bottom{
  47. position: fixed;
  48. bottom: 160rpx;
  49. right: 20rpx;
  50. width: 180rpx;
  51. }
  52. .pop_content {
  53. border-bottom: 1rpx solid #5c5c5c;
  54. display: flex;
  55. flex-direction: row;
  56. align-items: center;
  57. justify-content: flex-start;
  58. text-align: center;
  59. height: 80rpx;
  60. // line-height: 72rpx;
  61. padding-left: 10rpx;
  62. font-size: 28rpx;
  63. .ziyuan {
  64. position: absolute;
  65. color: #5c5c5c;
  66. width: 0;
  67. height: 0;
  68. border-bottom: 10px solid #555555;
  69. border-left: 10px solid transparent;
  70. border-right: 10px solid transparent;
  71. }
  72. .ziyuan-top{
  73. right: 25rpx;
  74. top: -16rpx;
  75. }
  76. .ziyuan-bottom{
  77. bottom: -18rpx;
  78. right: 50rpx;
  79. transform: rotate(180deg);
  80. }
  81. .icon {
  82. color: #fff;
  83. font-size: 32rpx;
  84. margin-left: 10rpx;
  85. }
  86. .title {
  87. color: #fff;
  88. margin-left: 10rpx;
  89. }
  90. }
  91. .pop_content:last-child {
  92. border-bottom: none;
  93. }
  94. </style>