Map.vue 998 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <div id="map">
  3. <node-map class="node-map" v-if="data" v-bind="one" />
  4. <node-map
  5. class="node-map" v-if="data2" v-bind="two"
  6. id="ùmqsldùml"
  7. />
  8. </div>
  9. </template>
  10. <script>
  11. import { toSingleManyData, toManyManyData } from '@/helpers/d3Data'
  12. import NodeMap from '@/components/NodeMap'
  13. export default {
  14. name: 'Home',
  15. components: {
  16. NodeMap
  17. },
  18. data () {
  19. return {
  20. id: 39,
  21. data: null,
  22. data2: null,
  23. one: { nodes: null, links: null },
  24. two: { nodes: null, links: null }
  25. }
  26. },
  27. created () {
  28. this.$store.dispatch('GET_TREE', this.id).then((data) => {
  29. this.data = data
  30. this.one = toSingleManyData(data)
  31. })
  32. this.$store.dispatch('GET_TREE', this.id).then((data) => {
  33. this.data2 = data
  34. this.two = toManyManyData(data)
  35. })
  36. }
  37. }
  38. </script>
  39. <style lang="scss" scoped>
  40. #map {
  41. height: 100%;
  42. width: 100%;
  43. display: flex;
  44. flex-basis: 50%;
  45. }
  46. .node-map {
  47. width: 50vw;
  48. }
  49. </style>