Map.vue 518 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <div id="map">
  3. <node-map v-if="data" :data="data" />
  4. <div>
  5. {{ data }}
  6. </div>
  7. </div>
  8. </template>
  9. <script>
  10. import NodeMap from '@/components/NodeMap'
  11. export default {
  12. name: 'Home',
  13. components: {
  14. NodeMap
  15. },
  16. data () {
  17. return {
  18. text: null,
  19. data: null
  20. }
  21. },
  22. created () {
  23. this.$store.dispatch('GET_TREE', 17).then((data) => {
  24. this.data = data
  25. })
  26. }
  27. }
  28. </script>
  29. <style lang="scss" scoped>
  30. #map {
  31. height: 100%;
  32. width: 100%;
  33. }
  34. </style>