index.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <div class="virtual-list" :style="{ height: list.length === 0 || list.length === 1 ? '452px' : '' }">
  3. <div class="charts" v-if="list && list.length > 0"
  4. :style="{ height: list.length === 0 || list.length === 1 ? '452px' : '' }">
  5. <!-- <RecycleScroller class="scroller" :items="diagramRelationsDatas" :item-size="452" key-field="fieldEngineCode"
  6. v-slot="{ item: itemChart }">
  7. <TwoDMarkersChart :key="itemChart.fieldEngineCode" :ref="itemChart.fieldEngineCode"
  8. :fileAddr="itemChart.fileAddr">
  9. </TwoDMarkersChart>
  10. </RecycleScroller> -->
  11. <!-- <template v-for="(itemChart, indChart) in diagramRelationsDatas">
  12. </template> -->
  13. <RecycleScroller class="scroller" :items="list" :item-size="itemSize" :key-field="keyField"
  14. v-slot="{ item, index }">
  15. <slot :item="item" :index="index"></slot>
  16. </RecycleScroller>
  17. </div>
  18. <el-empty description="暂无分析记录" v-else></el-empty>
  19. </div>
  20. </template>
  21. <script type="text/javascript">
  22. //import HelloWorld from '@/components/HelloWorld.vue'
  23. export default {
  24. name: "VirtualList",
  25. components: {},
  26. props: {
  27. list: {
  28. type: Array,
  29. default: () => []
  30. },
  31. keyField: {
  32. type: String,
  33. default: 'id'
  34. },
  35. itemSize: {
  36. type: Number,
  37. default: 300
  38. }
  39. },
  40. data() {
  41. return {
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. .charts {
  48. height: calc(100% - 150px);
  49. }
  50. .virtual-list {
  51. height: 100%;
  52. }
  53. .scroller {
  54. height: 100%;
  55. /* 隐藏垂直滚动条 */
  56. &::-webkit-scrollbar {
  57. width: 0;
  58. }
  59. /* 隐藏水平滚动条 */
  60. &::-webkit-scrollbar {
  61. height: 0;
  62. }
  63. }
  64. </style>