scrollViewR.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view>
  3. <view style="width: 90%;margin-left: 5%;margin-top: 20rpx;margin-bottom: 20rpx;">
  4. <view v-if="showTitle" class="titleText">
  5. <text>{{title}}</text>
  6. </view>
  7. <scroll-view scroll-x="true" class="ScontenView">
  8. <view class="contentInRowL">
  9. <view v-for="(item,index) in itemList">
  10. <view class="contentColumnC" style="width: 200rpx;padding-right: 12rpx" @click="itemSelect(index)">
  11. <image class="itemImage" :src="item.imagStr" mode="widthFix"></image>
  12. <text class="itemTitle">{{item.title}}</text>
  13. </view>
  14. </view>
  15. </view>
  16. </scroll-view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. name:"scrollViewR",
  23. props:{
  24. title:'',
  25. itemList:'',
  26. showTitle:false
  27. },
  28. data() {
  29. return {
  30. };
  31. },
  32. methods: {
  33. itemSelect(index){
  34. this.$emit('EitemSelect',index);
  35. },
  36. },
  37. }
  38. </script>
  39. <style lang="scss">
  40. // @font-face {
  41. // font-family: zrht;
  42. // src: url('/uni_modules/font/zrht.otf');
  43. // }
  44. .titleText{
  45. font-size: 28rpx;
  46. color: #1A1A1A;
  47. margin-top: 20rpx;
  48. margin-bottom: 20rpx;
  49. }
  50. .ScontenView{
  51. display: flex;
  52. flex-direction: row;
  53. justify-content: space-between;
  54. align-items: center;
  55. }
  56. .contentColumn{
  57. display: flex;
  58. flex-direction: column;
  59. align-items: center;
  60. justify-content: center;
  61. }
  62. .itemImage{
  63. width: 50rpx;
  64. }
  65. .itemTitle{
  66. font-size: 26rpx;
  67. color: #1A1A1A;
  68. text-align: center;
  69. }
  70. </style>