1.react,typescript,electron框架构建
2. 如何编译打包webview的preload
3.webview的内嵌方式,webview,browserview
4.集成扩展程序
5. electron 打windows和mac包 electron-builder build -wm --publish never
6.js注入导致第三方页面打开缓慢
关闭webview的webSecurity
7.excel文件导出
// 导出
import * as XLSX from 'xlsx';
const newList = []
const ws = XLSX.utils.json_to_sheet(newList);
const wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, 'Data');
const fileBuffer = XLSX.write(wb, { type: 'buffer' });
// 主进程
import {shell, ipcMain} from 'electron';
ipcMain.handle(MessageChannelsType.SAVE_FILE, async (event, arg) => {
const [options, buffer] = arg;
const res = await dialog.showSaveDialog(options);
if (!res.canceled) {
fs.writeFileSync(res.filePath, buffer);
// 下载完打开软件
shell.showItemInFolder(res.filePath);
}
return res;
});
8.excel文件导入
import * as XLSX from 'xlsx';
const importExcel = async (e)=>{
const file = e.target.files[0];
if (!file) return;
const res = await file.arrayBuffer();
const wb = XLSX.read(res); // parse the array buffer
const ws = wb.Sheets[wb.SheetNames[0]]; // get the first worksheet
const resData = XLSX.utils.sheet_to_json(ws); // generate objects
}
<input type="file" accept="application/vnd.ms- excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" onChange={importExcel} />
集成line,telegram,whatsapp,zalo的其他问题,例如自动翻译,获取用户信息和通讯录等,后面有空再补充