PortsCard.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <div class="ports-box">
  3. <TitleLine icon="info-dark" title="港口"></TitleLine>
  4. <div class="bar mt10" style="height: 700px">
  5. <div v-for="(item, index) in arr" :key="index" class="ports df aic mb20">
  6. <img class="mr10" :src="exchangeUrl('position')" alt="" />
  7. <div class="mr50">{{ index + 1 }}小洋山港口</div>
  8. <img :src="exchangeUrl(index % 2 == 0 ? 'sunny' : 'cloud')" alt="" />
  9. </div>
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. import { ref, onMounted, computed } from "vue";
  15. import { mapState } from "vuex";
  16. export default {
  17. setup() {
  18. let arr = ref([]);
  19. arr.value.length = 50;
  20. function init() {}
  21. function exchangeUrl(icon) {
  22. return `/${icon}.png`;
  23. }
  24. onMounted(() => {
  25. init();
  26. });
  27. return {
  28. init,
  29. exchangeUrl,
  30. arr,
  31. };
  32. },
  33. };
  34. </script>
  35. <style lang="scss" scoped>
  36. .ports {
  37. font-size: 14px;
  38. font-family: PingFangSC-Medium, PingFang SC;
  39. font-weight: 500;
  40. color: #e6f7ff;
  41. :first-child {
  42. width: 32px;
  43. height: 32px;
  44. }
  45. :last-child {
  46. width: 24px;
  47. height: 24px;
  48. }
  49. }
  50. .mr50 {
  51. margin-right: 50px;
  52. }
  53. </style>