scrollViewR.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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-family: zrht;
  46. font-size: 28rpx;
  47. color: #1A1A1A;
  48. margin-top: 20rpx;
  49. margin-bottom: 20rpx;
  50. }
  51. .ScontenView{
  52. display: flex;
  53. flex-direction: row;
  54. justify-content: space-between;
  55. align-items: center;
  56. }
  57. .contentColumn{
  58. display: flex;
  59. flex-direction: column;
  60. align-items: center;
  61. justify-content: center;
  62. }
  63. .itemImage{
  64. width: 50rpx;
  65. }
  66. .itemTitle{
  67. font-size: 26rpx;
  68. color: #1A1A1A;
  69. text-align: center;
  70. }
  71. </style>