总结
三套“算法宝典”
开源分享:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】
算法刷题LeetCode中文版(为例)
人与人存在很大的不同,我们都拥有各自的目标,在一线城市漂泊的我偶尔也会羡慕在老家踏踏实实开开心心养老的人,但是我深刻知道自己想要的是一年比一年有进步。
最后,我想说的是,无论你现在什么年龄,位于什么城市,拥有什么背景或学历,跟你比较的人永远都是你自己,所以明年的你看看与今年的你是否有差距,不想做咸鱼的人,只能用尽全力去跳跃。祝愿,明年的你会更好!
由于篇幅有限,下篇的面试技术攻克篇只能够展示出部分的面试题,详细完整版以及答案解析,有需要的可以关注
npm run electron:serve
electron打包复制代码
npm run electron:build
postinstall 和 postuninstall 是为了确保安装或者移除依赖时, 始终跟electron匹配
② 新增了background.js文件
主进程相关操作, 写在这个文件中
三、开发总结
1. 配置项目图标
使用electron-icon-builder
, 生成符合Electron的图标
① 安装
npm install --save-dev electron-icon-builder
② package.json
中配置生成命令
“electron:generate-icons”: “electron-icon-builder --input=./public/icon.png --output=build --flatten”
③ 生成图标
npm run electron:generate-icons
④ 使用
import path from 'path’const win = new BrowserWindow({
icon: path.join(__static, ‘icon.png’)
})
2. 在Mac系统下的几个问题
在mac系统下修改electron默认图标
在根目录下放置一张名为icon的图片,即icon.png即可。
在Mac系统下,复制粘贴无效的问题:
可以在创建窗口的时候自定义快捷键:
具体代码:
async function createWindow() {
createMenu();
// Create the browser window.
win = new BrowserWindow({
width: 1300,
height: 660,
minWidth: 1300,
useContentSize: true,
resizable: true,
// frame: false,
// backgroundColor: ‘#DC143C’,
// titleBarStyle: ‘hidden’,
webPreferences: {
webSecurity: false, //Remove cross domain restrictions
nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION,
// eslint-disable-next-line no-undef
preload: ${__static}/preload.js
},
//${__ Static} corresponds to the public directory
// eslint-disable-next-line no-undef
icon: ${__static}/img/icons/logo-64.png
// icon: ${__static}/img/icons/favicon.ico
});
if (process.platform === ‘darwin’) {
// eslint-disable-next-line no-undef
app.dock.setIcon(${__static}/img/icons/logo-512.png
);
}
if (process.env.WEBPACK_DEV_SERVER_URL) {
// Load the url of the dev server if in development mode
await win.loadURL(process.env.WEBPACK_DEV_SERVER_URL);
/* if (!process.env.IS_TEST) win.webContents.openDevTools(); */
} else {
createProtocol(‘app’);
// Load the index.html when not in development
win.loadURL(‘app://./index.html’);
//Detect version updates
updateHandle(win, feedUrl);
}
win.on(‘closed’, () => {
win = null;
});
globalShortcut.register(‘CommandOrControl+Shift+i’, function () {
win.webContents.openDevTools();
});
// esc,
globalShortcut.register(‘ESC’, function () {
win.unmaximize();
});
if (process.platform === ‘darwin’) {
const template = [
{
label: ‘Application’,
submenu: [
{
label: ‘Quit’,
accelerator: ‘Command+Q’,
click: function () {
app.quit();
}
}
]
},
{
label: ‘Edit’,
submenu: [
{ label: ‘Copy’, accelerator: ‘CmdOrCtrl+C’, selector: ‘copy:’ },
JavaScript
-
js的基本类型有哪些?引用类型有哪些?null和undefined的区别。
-
如何判断一个变量是Array类型?如何判断一个变量是Number类型?(都不止一种)
-
Object是引用类型嘛?引用类型和基本类型有什么区别?哪个是存在堆哪一个是存在栈上面的?
-
JS常见的dom操作api
-
解释一下事件冒泡和事件捕获
-
事件委托(手写例子),事件冒泡和捕获,如何阻止冒泡?如何组织默认事件?
-
对闭包的理解?什么时候构成闭包?闭包的实现方法?闭包的优缺点?
-
this有哪些使用场景?跟C,Java中的this有什么区别?如何改变this的值?
-
call,apply,bind
-
显示原型和隐式原型,手绘原型链,原型链是什么?为什么要有原型链
-
创建对象的多种方式
-
实现继承的多种方式和优缺点
-
new 一个对象具体做了什么
-
手写Ajax,XMLHttpRequest
-
变量提升
-
举例说明一个匿名函数的典型用例
-
指出JS的宿主对象和原生对象的区别,为什么扩展JS内置对象不是好的做法?有哪些内置对象和内置函数?
-
attribute和property的区别
-
document load和document DOMContentLoaded两个事件的区别
-
JS代码调试
-
开源分享:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】