桌面,底部导航 多个窗口

This commit is contained in:
zdg 2024-09-03 16:01:40 +08:00
parent eb3778dde2
commit b6504e114f
1 changed files with 5 additions and 5 deletions

View File

@ -14,11 +14,11 @@ const API = isNode?window.api:{} // preload-api
// import { useToolState } from '@/store/modules/tool' // 获取store状态
// const Store = isNode?require('electron-store'):null // 持久化存储
import store from './store'
// 常用变量
const BaseUrl = isNode?process.env['ELECTRON_RENDERER_URL']+'/#':''
const isDev = isNode?process.env.NODE_ENV !== 'production':''
// const toolState = useToolState() // 获取store状态
const appPath = isNode?Remote.app.getAppPath():'' // 应用目录
// 暴露Remote中的属性
export const ipcMain = Remote?.ipcMain || {}
@ -110,6 +110,7 @@ export const createWindow = async (type, data) => {
resizable: false, // 禁止窗口大小缩放
transparent: true, // 设置透明
alwaysOnTop: true, // 窗口是否总是显示在其他窗口之前
type: 'toolbar', // 创建的窗口类型为工具栏窗口
// parent: mainWin, // 父窗口
// autoClose: true, // 关闭窗口后自动关闭
}
@ -179,8 +180,7 @@ export function toolWindow({url, isConsole, isWeb=true, option={}}) {
return new Promise((resolve) => {
const config = {
width, height,
type: 'toolbar', // 创建的窗口类型为工具栏窗口
// icon: path.join(__dirname, '../../resources/logo2.ico'),
icon: path.join(appPath, '/resources/logo2.ico'),
webPreferences: {
preload: path.join(API.preloadPath, '/index.js'),
sandbox: false,