mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-19 11:56:36 +08:00
add electron-is-dev
This commit is contained in:
parent
457989c840
commit
0fa706437d
@ -2,11 +2,12 @@ import { createApp } from 'vue'
|
|||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
// vite 会编译 import 的形式;所以 electron 及 node.js 内置模块用 require 形式
|
// vite 会编译 import 的形式;所以 electron 及 node.js 内置模块用 require 形式
|
||||||
const { ipcRenderer } = require('electron')
|
const { ipcRenderer } = require('electron')
|
||||||
import store from '/utils/store'
|
import { store, isdev } from '/utils/index'
|
||||||
|
|
||||||
import './index.css'
|
import './index.css'
|
||||||
|
|
||||||
console.log('ipcRenderer:', ipcRenderer)
|
console.log('ipcRenderer:', ipcRenderer)
|
||||||
console.log('Store', store)
|
console.log('Store', store)
|
||||||
|
console.log('electron is dev', isdev)
|
||||||
|
|
||||||
createApp(App as any).mount('#app')
|
createApp(App as any).mount('#app')
|
||||||
|
7
src/render/utils/index.ts
Normal file
7
src/render/utils/index.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import store from './store'
|
||||||
|
const isdev = require('electron-is-dev')
|
||||||
|
|
||||||
|
export {
|
||||||
|
store,
|
||||||
|
isdev,
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user