index.vue 739 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <view class="charts" v-if="show">
  3. <charts :config="config" :key="key" @getIndex="getIndex" @complete='complete' :markPoints="markPoints"
  4. :regionStep="regionStep" @regionStepClick="regionStepClick" ref="charts" :loading="pointLoading"></charts>
  5. </view>
  6. </template>
  7. <script>
  8. import charts from './charts.vue'
  9. import chartsJs from '../chartsJs.js'
  10. export default {
  11. mixins: [chartsJs],
  12. components: {
  13. charts
  14. },
  15. props: {
  16. config: {
  17. type: Object,
  18. default: () => {}
  19. }
  20. },
  21. data() {
  22. return {
  23. key: +new Date(),
  24. }
  25. },
  26. methods: {
  27. complete(e) {
  28. if (this.config.jnpfKey === 'mapChart') this.setPoints(e)
  29. }
  30. }
  31. }
  32. </script>
  33. <style lang="scss">
  34. .charts {
  35. padding: 20rpx;
  36. }
  37. </style>