-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 更新了项目的README文件,增加了详细的使用说明。 - 添加了一个新的教程部分。 - 修正了一些文档中的错别字和格式问题。
- Loading branch information
1 parent
cbefc70
commit 4991b12
Showing
19 changed files
with
449 additions
and
624 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# Electron | ||
|
||
## Better-sqlite3 | ||
|
||
### 注意事项 | ||
|
||
1. Select 字句的字段名不能用 `''` 包裹 | ||
2. get()空结果为 undefined 不是 null | ||
|
||
### 编译 | ||
|
||
better-sqlite3 是 Node.js 包,不是 Electron 包。所以需要使用 [@electron/rebuild](https://github.com/electron/rebuild) 来编译成 Electron 可以使用的包。 | ||
|
||
> **注意** | ||
> | ||
> 原来的 electron-rebuild 已经弃用。现在由 @electron/rebuild 代替 | ||
安装依赖 | ||
|
||
```powershell | ||
# 安装依赖 | ||
# @electron/rebuild 依赖 node-gyp | ||
npm install -g node-gyp | ||
npm install --save-dev @electron/rebuild | ||
``` | ||
|
||
windows 终端直接编译 | ||
|
||
```powershell | ||
node_modules/.bin/electron-rebuild -f -w better-sqlite3 | ||
``` | ||
|
||
可以可以用 npm 编译 | ||
先再 package.json 中添加 | ||
|
||
```json | ||
"scripts": { | ||
"rebuild": "electron-rebuild -f -w yourmodule" | ||
} | ||
``` | ||
|
||
然后再终端运行 | ||
|
||
```powershell | ||
npm run rebuild | ||
``` | ||
|
||
## 路径处理 | ||
|
||
### 路径保存 | ||
|
||
保存的路径要统一去除最外的分隔符 | ||
|
||
```powershell | ||
# 正确 | ||
C:\ | ||
C:\bar\foor | ||
# 错误 | ||
C:. | ||
C:\bar\boor\ | ||
``` | ||
|
||
### node:path 的 resolve, join, normalize | ||
|
||
#### windows 盘符 | ||
|
||
```js | ||
const p1 = "C"; | ||
const p2 = "C:"; | ||
const p3 = "C:."; | ||
const p4 = "C:\\"; | ||
|
||
// resolve | ||
// ${__dirname}\C | ||
// C:\ | ||
// C:\ | ||
// C:\ | ||
|
||
// join 、normalize | ||
// C | ||
// C:. | ||
// C:. | ||
// C:\ | ||
``` | ||
|
||
#### 最外层分隔符 | ||
|
||
> C:\ | ||
> | ||
> C:\user\ | ||
> | ||
> C:\user | ||
path.resolve() 不会保留最外部的分隔符 | ||
|
||
path.normalize() 会保留最外的分隔符 | ||
|
||
#### 结论 | ||
|
||
对要保存的路径做 resolve 处理, 因为盘符处理是一致的,路径统一去除最外的分隔符 | ||
|
||
对路径截取操作适合使用 normlize,对分隔符的保留使得路径比对更方便。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Render | ||
|
||
## z-index 表 | ||
|
||
| 组件 | z-index | 使用次数 | | ||
| --------------- | ------- | -------- | | ||
| 右键菜单 | 3000 | 2 | | ||
| backtop | 1000 | 1 | | ||
| check-container | 100 | 1 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
从 | ||
echo metadata json 格式如下 | ||
|
||
[echo metadata echema](../src/main/constant/echo_metadata_schema.ts) |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.