picGrid.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template name="picGrid">
  2. <view class="cover">
  3. <block v-for="(v, k) in item.text">
  4. <image :class="['abs-tag', position[v.text-1]]" v-if="v.pic" :src="v.pic" mode="widthFix"></image>
  5. </block>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. name: "picGrid",
  11. props: {
  12. config : {
  13. type : Object,
  14. value : null
  15. },
  16. item : {
  17. type : Object,
  18. value : null
  19. },
  20. },
  21. data() {
  22. return {
  23. position: ["tl","tr","bl","br"],
  24. };
  25. },
  26. methods:{
  27. },
  28. }
  29. </script>
  30. <style>
  31. .abs-tag {
  32. position: fixed;
  33. color: #fff;
  34. display: flex;
  35. flex-direction: column;
  36. }
  37. .abs-tag view{
  38. line-height: 1em;
  39. overflow: hidden;
  40. }
  41. .abs-tag text {
  42. background-color: #000;
  43. margin-bottom: 10rpx;
  44. font-size: 28rpx;
  45. line-height: 1;
  46. padding: 0 2rpx;
  47. }
  48. .abs-tag.tl {
  49. }
  50. .abs-tag.tr {
  51. right: 0rpx;
  52. }
  53. .abs-tag.bl {
  54. width: 50%;
  55. height:50%;
  56. bottom: 125rpx;
  57. left: 30rpx;
  58. }
  59. .abs-tag.br {
  60. width: 50%;
  61. height:50%;
  62. bottom: 125rpx;
  63. right: 30rpx;
  64. text-align: right;
  65. }
  66. </style>