496 Star 5.6K Fork 1.5K

GVPdromara/electron-egg

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Index.vue 1.62 KB
一键复制 编辑 原始数据 按行查看 历史
gaoshuaixing 提交于 4个月前 . feat: demo-js v4
<template>
<div id="app-os-window">
<div class="one-block-1">
<span>
1. 新窗口中加载web内容
</span>
</div>
<div class="one-block-2">
<a-space>
<a-button @click="createWindow(0)">打开哔哩哔哩</a-button>
</a-space>
</div>
<div class="one-block-1">
<span>
2. 新窗口中加载html内容
</span>
</div>
<div class="one-block-2">
<a-space>
<a-button @click="createWindow(1)">打开html页面</a-button>
</a-space>
</div>
<div class="one-block-1">
<span>
3. 新窗口中加载当前项目页面
</span>
</div>
<div class="one-block-2">
<a-space>
<a-button @click="createWindow(2)">打开vue页面</a-button>
</a-space>
</div>
</div>
</template>
<script setup>
import { ipcApiRoute } from '@/api';
import { ipc } from '@/utils/ipcRenderer';
const views = [
{
type: 'web',
content: 'https://www.bilibili.com/',
windowName: 'window-web',
windowTitle: 'bilibili'
},
{
type: 'html',
content: '/public/html/view_example.html',
windowName: 'window-html',
windowTitle: 'html window'
},
{
type: 'vue',
content: '#/special/subwindow',
windowName: 'window-vue',
windowTitle: 'vue window'
},
];
function createWindow(index) {
ipc.invoke(ipcApiRoute.os.createWindow, views[index])
}
</script>
<style lang="less" scoped>
#app-os-window {
padding: 0px 10px;
text-align: left;
width: 100%;
.one-block-1 {
font-size: 16px;
padding-top: 10px;
}
.one-block-2 {
padding-top: 10px;
}
}
</style>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/dromara/electron-egg.git
git@gitee.com:dromara/electron-egg.git
dromara
electron-egg
electron-egg
demo

搜索帮助