feat: accept graph sent from server

This commit is contained in:
wancat committed 2023-08-28 19:36:38 +08:00
1 parent 45813ebbc0
commit 54592831ee
1 file changed
+9 -1
+9 -1
View File
@@ -1,6 +1,7 @@
<script setup> <script setup>
import { ref } from 'vue' import { onMounted, ref } from 'vue'
import FileNode from './FileNode.vue' import FileNode from './FileNode.vue'
import socket from '../utils/socket.js'
const graph = ref({ const graph = ref({
path: '/', path: '/',
@@ -52,6 +53,13 @@ const graph = ref({
}, },
], ],
}) })
onMounted(() => {
socket.on('graph', (event) => {
// TODO: update graph
console.log(event)
})
})
</script> </script>
<template> <template>