<template>
    <hc-app-config>
        <router-view />
    </hc-app-config>
</template>

<script setup>
import { nextTick } from 'vue'
import { toPage } from './utils/tools'
import { isNullES, setElementMainColor } from 'js-fast-way'

nextTick(() => {
    setIpcRenderer()
    setElementMainColor('#02a271')
})

//设置通信监听
const setIpcRenderer = () => {
    window.electron.ipcRenderer.on('open-file-vue', (event, { data }) => {
        console.log('open-file-data', data)
        if (isNullES(data) || data === 'win') return
        toPage({
            page: '/project',
            query: {
                path: data,
                source: '',
            },
        })
    })
}
</script>

