m-title.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view class="m-tap">
  3. <template v-if="num == 0">
  4. <image src="~@/static/img/seckill.png" mode=""></image>
  5. </template>
  6. <template else-if="num == 1">
  7. <image src="~@/static/img/seckill.png" mode=""></image>
  8. </template>
  9. <template else="num == 2">
  10. <image src="~@/static/img/seckill.png" mode=""></image>
  11. </template>
  12. <text class="iconfont iconenter">更多</text>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. name: 'm-title',
  18. data() {
  19. return {
  20. imgUrl: [
  21. '~@/static/img/seckill.png','~@/static/img/groupBooking.png','~@/static/img/exchange.png'
  22. ]
  23. };
  24. },
  25. props: {
  26. num: {
  27. type: String,
  28. default: '0'
  29. }
  30. },
  31. computed: {
  32. imgSrc() {
  33. return this.imgUrl[this.num*1]
  34. }
  35. }
  36. };
  37. </script>
  38. <style lang="scss">
  39. .m-tap {
  40. height: 66rpx;
  41. margin-top: 49rpx;
  42. display: flex;
  43. position: relative;
  44. image {
  45. width: 295rpx;
  46. height: 66rpx;
  47. position: absolute;
  48. left: 0;
  49. right: 0;
  50. margin: 0 auto;
  51. }
  52. .iconenter {
  53. font-size: 26rpx;
  54. color: $font-color-light;
  55. position: absolute;
  56. right: 25rpx;
  57. top: 21rpx;
  58. }
  59. }
  60. </style>