vue2結合electron開發桌面端應用

一、Electron是什么?

Electron是一個使用 JavaScript、HTML 和 CSS 構建桌面應用程序的框架。 嵌入?Chromium?和?Node.js?到 二進制的 Electron 。允許您保持一個 JavaScript 代碼代碼庫并創建可在Windows、macOS和Linux上運行的跨平臺應用 。

Electron 經常與 Chromium 一起發布主版本。 本文檔側重于發布排期和版本支持政策。 要更深入地了解我們的git 分支和Electron如何使用語義版本, 請查看我們的?Electron 版本文檔。?

安裝Electron時注意要選擇使用其支持的node版本的開發環境。

時間表?

ElectronAlpha測試版穩定版EOLChromeNode支持
29.0.02023-Dec-072024年3月24日2024年2月20日2024年8月20日M122v18.19?
28.0.02023年11月10日2023年11月06日2023年12月5日2024年6月11日M120v18.18?
27.0.02023年8月17日2023年9月13日2023年10月10日2024年4月16日M118v18.17?
26.0.02023年6月01日2023年6月27日2023年8月15日2024年2月20日M116v18.16?
25.0.02023年4月10日2023年5月02日2023年5月30日2023年12月5日M114v18.15🚫
24.0.02023年2月09日2023年3月07日2023年4月04日2023年10月10日M112v18.14🚫
23.0.02022年12月1日2023年3月10日2023年2月7日2023年8月15日M110v18.12🚫
22.0.02022年9月29日2022年10月25日2022年11月29日2023年10月10日M108v16.17🚫
21.0.02022年8月4日2022年8月30日2022年9月27日2023年4月04日M106v16.16🚫
20.0.02022年5月26日2022年6月21日2022年8月2日2023年2月7日M104v16.15🚫
19.0.02022年3月31日2022年4月26日2022年5月24日2022年11月29日M102v16.14🚫
18.0.02022年2月3日2022年3月3日2022年3月29日2022年9月27日M100v16.13🚫
17.0.02021年11月18日2022年1月6日2022年2月1日2022年8月2日M98v16.13🚫
16.0.02021年9月23日2021年10月20日2021年11月16日2022年5月24日M96v16.9🚫
15.0.02021年7月20日2021年9月01日2021年9月21日2022年5月24日M94v16.5🚫
14.0.0--2021年5月27日2021年8月31日2022年3月29日M93v14.17🚫
13.0.0--2021年3月4日2021年5月25日2022年2月1日M91v14.16🚫
12.0.0--2020年11月19日2021年3月2日2021年11月16日M89v14.16🚫
11.0.0--2020年8月27日2020年11月17日2021年8月31日M87v12.18🚫
10.0.0--2020年5月21日2020年8月25日2021年5月25日M85v12.16🚫
9.0.0--2020年2月6日2020年5月19日2021年3月2日M83v12.14🚫
8.0.0--2019年10月24日2020年2月4日2020年11月17日M80v12.13🚫
7.0.0--2019年8月1日2019年10月22日2020年8月25日M78v12.8🚫
6.0.0--2019年4月25日2019年7月30日2020年5月19日M76v12.14.0🚫
5.0.0--2019年3月22日2019年4月23日2020年2月4日M73v12.0🚫
4.0.0--2018年10月11日2018年2月1日2019年10月22日M69v10.11🚫
3.0.0--2018年6月21日2018年9月18日2019年7月30日M66v10.2🚫
2.0.0--2018年2月1日2018年5月01日2019年4月23日M61v8.9🚫

二、?解決npm淘寶鏡像到期問題?

報錯信息:
Could not retrieve?https://npm.taobao.org/mirrors/node/latest/SHASUMS256.txt.
Get "https://npm.taobao.org/mirrors/node/latest/SHASUMS256.txt": x509: certificate has expired or is not yet valid:

解決方法:?

<1>.如果使用nvm做node的版本管理 ,則也需要更換nvm倉庫鏡像地址,更換方法如下:

node_mirror: https://npmmirror.com/mirrors/node/
npm_mirror: https://npmmirror.com/mirrors/npm/

?<2>.切換npm鏡像倉庫--如果你是將npm官方鏡像改成了淘寶鏡像,則需要按下面步驟去手動更新。

// 1. 清空緩存
npm cache clean --force// 2. 切換新源
npm config set registry https://registry.npmmirror.com// 3. 檢測是否切換成功
npm config get registry

<3>.更換成cnpm淘寶命令工具cnpm的使用方式:

// 1. 安裝cnpm
npm install -g cnpm --registry=https://registry.npmmirror.com// 2. 檢測是否安裝成功
cnpm -v

緩存位置

window下的緩存位置(npm全局位置):
user\xxx\AppData\Roaming\npm-cache當中的_cacache文件夾

清理緩存?

// 強制刪除緩存
npm cache clean -f
// 無論在項目中執行命令,還是在全局執行命令
// 都會去刪除當前npm的所有緩存內容,即是刪除_cacache文件夾

?應用場景

// 有時npm install因為緩存導致的報錯,需按如下步驟操作
1、刪除node_module文件夾
2、npm cache clear -f
3、npm instaall

三、npm安裝Electron 項目失敗報錯問題和解決辦法?

在這一步就跟定住了一樣,一動不動,時間長了就報錯?

?解決辦法

1、打開npm的配置文件

npm config edit

?2、在打開的配置文件空白處將下面幾個配置添加上去,注意如果有原有的這幾項配置,就修改

registry=https://registry.npmmirror.com
electron_mirror=https://cdn.npmmirror.com/binaries/electron/
electron_builder_binaries_mirror=https://npmmirror.com/mirrors/electron-builder-binaries/

或者

注:在安裝 electron 的過程中會根據開發者的當前的操作系統去下載 electron 的二進制包,在下載過程中由于網絡的原因會導致下載失敗,對應的解決方案是指定國內的鏡像,如淘寶鏡像。
#指定 npm 倉庫地址

?

?npm config set registry https://registry.np mmirror . com?

#指定 electron 二進制包的鏡像地址
?

?npm config set ELECTRON _ MIRROR -"https://npmmirror.con/mirrors/electron/"

檢測 npm 倉庫和 electron 鏡像地址是否設置成功
?

?npm config list?

# lotjol @ localhost in ~[12:14:17]
?npm config list?
" user " config from / Users / lotjol /. npmrc?
?ELECTRON _ MIRROR ="https://npmmirror.com/mirrors/electron/"
?home ="https://npm.taobao.org"
?registry ="https://registry.np mmirror . com /"

?

3、然后關閉該窗口,重啟命令行,刪除node_modules文件夾,并執行下面命令清除緩存,再重新安裝依賴

npm cache clean --force

4.安裝electron測試

四、安裝 electron-builder報錯解決辦法

報錯原因:

由于 vue add?之前使用的淘寶源,現在淘寶源證書到期,所以報錯。

解決辦法:?

修改 vue 的設置,在c盤用戶目錄下的 vue.rc 文件中修改為false,使得之后的vue add 不再走淘寶鏡像即可。

五、vue2結合electron開發跨平臺應用(桌面端應用)

1.確定nodejs和electron的版本號??

確定nodejs和electron的版本號及其重要,因為electron的開發版本需要指定的nodejs版本支持。?

?本文安裝測試使用的是:

? ?1.node18.19.0

? ?2.npm10.2.3?

? ?3.vue-cli5.0.8

? ?4.electron29.0.0

??

2.創建vue2項目?

vue create elctron29.0.0_node18.19.0_vuecli5.0.8_vue2

?

3.安裝electron?

npm install electron@29.0.0 --save-dev

?

?4.安裝electron-builder

vue add electron-builder

?在項目的src目錄下增加了文件,并在注入

5.啟動electron項目?

npm run electron:serve 

?

首次啟動會加載相當緩慢,會有如下提示信息:?

Failed to fetch extension, trying 4 more times
Failed to fetch extension, trying 3 more times
Failed to fetch extension, trying 2 more times
Failed to fetch extension, trying 1 more times
Failed to fetch extension, trying 0 more times

?解決首次加載緩慢的辦法:

? ?在項目中找到background.js文件,注釋background.js文件中的這段代碼:import? ? ? ?installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer'

?再次啟動測試

很快就啟動成功了!?

6.打包electron項目

 npm run electron:build

使用?electron-builder 構建 vue 項目,運行 npm run electron:build ,構建過程報錯。這個錯誤可能是由于使用的 Node.js 版本過高,不支持當前的 OpenSSL 版本,導致構建失敗。解決這個問題的方法是在構建命令前設置 NODE_OPTIONS 環境變量,強制使用 OpenSSL 的舊版提供程序。?

報錯提示


C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2>npm run electron:build

> elctron29.0.0_node18.19.0_vuecli5.0.8_vue2@0.1.0 electron:build
> vue-cli-service electron:build

?INFO ?Bundling render process:
All browser targets in the browserslist configuration have supported ES module.
Therefore we don't build two separate bundles for differential loading.


- ?Building for production...

?DONE ?Compiled successfully in 4261ms ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?13:26:43
? File ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Size ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Gzipped

? dist_electron\bundled\js\chunk-vendors.91055014.js ? ?127.60 KiB ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 43.44 KiB
? dist_electron\bundled\js\app.60bf7bcd.js ? ? ? ? ? ? ?15.53 KiB ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?9.52 KiB
? dist_electron\bundled\js\about.85649f72.js ? ? ? ? ? ?0.50 KiB ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0.32 KiB
? dist_electron\bundled\css\app.bc18c568.css ? ? ? ? ? ?0.42 KiB ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0.26 KiB

? Images and other types of assets omitted.
? Build at: 2024-03-02T05:26:43.958Z - Hash: 1ffa631b94053caa - Time: 4261ms

?DONE ?Build complete. The dist_electron\bundled directory is ready to be deployed.
?INFO ?Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html

/ ?Bundling main process...

?ERROR ?Failed to compile with 1 errors ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 13:26:45

?error

background.js from Terser
Error: error:0308010C:digital envelope routines::unsupported
? ? at new Hash (node:internal/crypto/hash:69:19)
? ? at Object.createHash (node:crypto:133:10)
? ? at C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\node_modules\terser-webpack-plugin\dist\index.js:217:37
? ? at Array.forEach (<anonymous>)
? ? at TerserPlugin.optimizeFn (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\node_modules\terser-webpack-plugin\dist\index.js:160:259)
? ? at _next0 (eval at create (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:8:1)
? ? at eval (eval at create (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:23:1)
? ? at processTicksAndRejections (node:internal/process/task_queues:95:5)

C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\index.js:198
? ? ? ? ? ? ? throw new Error('Build failed with errors.')
? ? ? ? ? ? ? ? ? ? ^

Error: Build failed with errors.
? ? at C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\index.js:198:21
? ? at finalCallback (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\Compiler.js:257:39)
? ? at C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\Compiler.js:273:13
? ? at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
? ? at AsyncSeriesHook.lazyCompileHook (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\tapable\lib\Hook.js:154:20)
? ? at onCompiled (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\Compiler.js:271:21)
? ? at C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\Compiler.js:681:15
? ? at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
? ? at AsyncSeriesHook.lazyCompileHook (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\tapable\lib\Hook.js:154:20)
? ? at C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\Compiler.js:678:31
? ? at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
? ? at AsyncSeriesHook.lazyCompileHook (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\tapable\lib\Hook.js:154:20)
? ? at C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\Compilation.js:1423:35
? ? at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
? ? at AsyncSeriesHook.lazyCompileHook (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\tapable\lib\Hook.js:154:20)
? ? at C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\lib\Compilation.js:1414:32
? ? at eval (eval at create (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:12:1)
? ? at C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\node_modules\terser-webpack-plugin\dist\index.js:321:9
? ? at TaskRunner.run (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\node_modules\terser-webpack-plugin\dist\TaskRunner.js:48:7)
? ? at TerserPlugin.optimizeFn (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\webpack\node_modules\terser-webpack-plugin\dist\index.js:227:18)
? ? at _next0 (eval at create (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:8:1)
? ? at eval (eval at create (C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2\node_modules\vue-cli-plugin-electron-builder\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:23:1)
? ? at processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.19.0

C:\Users\63002\Desktop\elctron29.0.0_node18.19.0_vuecli5.0.8_vue2>

解決方案

打開package.json,找到

  "scripts": {"electron:build": "vue-cli-service electron:build",},

改為

  "scripts": {"electron:build": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service electron:build",},

?通過設置 NODE_OPTIONS 環境變量為 --openssl-legacy-provider,可以強制使用舊版的 OpenSSL 提供程序,從而解決構建過程中的報錯問題。

再次打包測試

?

可以正常打包,不報錯了。?

注意:

1.打包windows桌面端軟件要在windows系統的真機或者虛擬機上進行打包。同樣打包Mac系統的桌面端軟件要在Mac系統的真機或者虛擬機上進行打包。其他操作系統同理。

2.如果要打包發布到對應應用商店需要代碼簽名。https://www.electronjs.org/zh/docs/latest/tutorial/%E6%89%93%E5%8C%85%E6%95%99%E7%A8%8B

7.安裝打包后的軟件

源碼:GitHub - 1t1824d/elctron29.0.0_node18.19.0_vuecli5.0.8_vue2?

?參考:

1.解決npm淘寶鏡像到期問題_npm淘寶鏡像過期了怎么辦-CSDN博客

2.npm---緩存_npm cache-CSDN博客?

3.nvm,nrm,npx的使用(淘寶源證書到期解決) - 知乎

4.vue_electron問題總結_vue add electron-builder electron 版本問題-CSDN博客

5.npm安裝Electron 項目失敗報錯問題和解決辦法_npm install electron報錯-CSDN博客

6.【Electron+Vue】Error: error:0308010C:digital envelope routines::unsupported_background.js from terser error: error:0308010c:di-CSDN博客

7.解決electron+vue項目起始加載慢的問題_electron嵌入的網頁加載太慢-CSDN博客?

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/715793.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/715793.shtml
英文地址,請注明出處:http://en.pswp.cn/news/715793.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

scrapy 中間件

就是發送請求的時候&#xff0c;會經過&#xff0c;中間件。中間件會處理&#xff0c;你的請求 下面是代碼&#xff1a; # Define here the models for your spider middleware # # See documentation in: # https://docs.scrapy.org/en/latest/topics/spider-middleware.html…

【快速上手ProtoBuf】基本使用

文章目錄 1 :peach:初識 ProtoBuf:peach:1.1 :apple:序列化概念:apple:1.2 :apple:ProtoBuf 是什么:apple:1.3 :apple:ProtoBuf 的使用特點:apple: 2 :peach:創建 .proto ?件:peach:3 :peach:編譯 .proto 文件:peach:3 :peach:序列化與反序列化的使用:peach: 1 &#x1f351;初…

洛谷 2036.PERKET

采用遞歸法的方式進行題解。 思路&#xff1a;首先我們知道在n種材料當中&#xff0c;我們需要從中選擇至少有一種得配料才行。也就是說&#xff0c;我們選擇的配料數目是自己決定的&#xff0c;而不是那種組合型得對于你有要求的組合型遞歸方式。 所以我們會想到用指數型得遞…

(五)網絡優化與超參數選擇--九五小龐

網絡容量 網絡中神經單元數越多&#xff0c;層數越多&#xff0c;神經網路的擬合能力越強。但是訓練速度&#xff0c;難度越大&#xff0c;越容易產生過擬合。 如何選擇超參數 所謂超參數&#xff0c;也就是搭建神經網路中&#xff0c;需要我們自己去選擇&#xff08;不是通…

LeetCode 刷題 [C++] 第45題.跳躍游戲 II

題目描述 給定一個長度為 n 的 0 索引整數數組 nums。初始位置為 nums[0]。 每個元素 nums[i] 表示從索引 i 向前跳轉的最大長度。換句話說&#xff0c;如果你在 nums[i] 處&#xff0c;你可以跳轉到任意 nums[i j] 處: 0 < j < nums[i]i j < n 返回到達 nums[n …

遞歸函數(c++題解)

題目描述 對于一個遞歸函數w(a, b, c)。 如果a < 0 or b < 0 or c < 0就返回值1。 如果a > 20 or b > 20 or c > 20就返回W(20,20,20)。 如果a < b并且b < c 就返回w(a, b, c ? 1) w(a, b ? 1, c ? 1) ? w(a, b ? 1, c)&#xff0c; 其它別…

計算機網絡知多少-第1篇

一、 從輸入URL到頁面展示到底發生了什么&#xff1f; 1. 首先瀏覽器會查看電腦本地緩存&#xff0c;如果有直接返回&#xff0c;否則需要進行下一步的網絡請求。 2. 在網絡請求之前&#xff0c;需要先進行DNS解析&#xff0c;來找到請求域名的ip地址。如果是HTTPS請求&#…

【C語言】熟悉文件基礎知識

歡迎關注個人主頁&#xff1a;逸狼 創造不易&#xff0c;可以點點贊嗎~ 如有錯誤&#xff0c;歡迎指出~ 文件 為了數據持久化保存&#xff0c;使用文件&#xff0c;否則數據存儲在內存中&#xff0c;程序退出&#xff0c;內存回收&#xff0c;數據就會丟失。 程序設計中&…

微信小程序,h5端自適應登陸方式

微信小程序端只顯示登陸(獲取opid),h5端顯示通過賬戶密碼登陸 例如: 通過下面的變量控制: const isWeixin ref(false); // #ifdef MP-WEIXIN isWeixin.value true; // #endif

Git 查看提交歷史

命令說明git log查看歷史提交記錄git blame (file)以列表形式查看指定文件的歷史修改記錄 git log 在使用 Git 提交了若干更新之后&#xff0c;又或者克隆了某個項目&#xff0c;想回顧下提交歷史&#xff0c;我們可以使用 git log 命令查看。 git log 命令用于查看 Git 倉庫中…

LIN基礎:從LIN Frame開始

目錄&#xff1a; 1、LIN的網絡拓撲 2、LIN Frame 1&#xff09;Header 2&#xff09;Response 3、LIN的通信規則 1&#xff09;LIN的發送行為示例 2&#xff09;LIN的接收行為示例 雖然LIN總線的通信速率不高&#xff0c;工程中&#xff0c;最高的速率也就19200bps。…

c語言extern關鍵字

extern 是C和C中的關鍵字&#xff0c;用于聲明一個變量或函數的存在&#xff0c;但不進行定義。 它通常用于在一個源文件中引用另一個源文件中定義的變量或函數。 例如&#xff0c;extern int x; 表示 x 是一個整數變量&#xff0c;但它的實際定義將在其他文件中。在引用它的文…

StarRocks——Stream Load 事務接口實現原理

目錄 前言 一、StarRocks 數據導入 二、StarRocks 事務寫入原理 三、InLong 實時寫入StarRocks原理 3.1 InLong概述 3.2 基本原理 3.3 詳細流程 3.3.1 任務寫入數據 3.3.2 任務保存檢查點 3.3.3 任務如何確認保存點成功 3.3.4 任務如何初始化 3.4 Exactly Once 保證…

Leetcode - 周賽386

目錄 一&#xff0c;3046. 分割數組 二&#xff0c;3047. 求交集區域內的最大正方形面積 三&#xff0c;3048. 標記所有下標的最早秒數 I 四&#xff0c;3049. 標記所有下標的最早秒數 II 一&#xff0c;3046. 分割數組 將題目給的數組nums分成兩個數組&#xff0c;且這兩個…

探索RedisJSON:將JSON數據力量帶入Redis世界

探索RedisJSON&#xff1a;將JSON數據力量帶入Redis世界 當我們談論數據存儲和查詢時&#xff0c;Redis和JSON都是無法忽視的重要角色。Redis以其高效的鍵值存儲、快速的讀/寫速度、以及豐富的數據結構贏得了開發者的喜愛。而JSON&#xff0c;作為一種輕量級的數據交換格式&am…

「Vue3系列」Vue3 條件語句/循環語句

文章目錄 一、Vue3 條件語句1. v-if2. v-else-if 和 v-else3. v-show4. 使用計算屬性進行條件渲染5. v-if與v-show比較v-ifv-show性能考慮使用場景 二、Vue3 循環語句1. 遍歷數組2. 遍歷對象3. 使用索引4. 注意事項 三、相關鏈接 一、Vue3 條件語句 在 Vue 3 中&#xff0c;你…

盲人出行:科技創造美好的未來

在繁忙的都市中&#xff0c;我每天都要面對許多挑戰&#xff0c;盲人出行安全保障一直難以得到落實。我看不見這個世界&#xff0c;只能依靠觸覺和聽覺來感知周圍的一切。然而&#xff0c;我從未放棄過對生活的熱愛和對未來的憧憬。在一次機緣巧合下&#xff0c;我認識了一款名…

C3_W2_Collaborative_RecSys_Assignment_吳恩達_中英_Pytorch

Practice lab: Collaborative Filtering Recommender Systems(實踐實驗室:協同過濾推薦系統) In this exercise, you will implement collaborative filtering to build a recommender system for movies. 在本次實驗中&#xff0c;你將實現協同過濾來構建一個電影推薦系統。 …

VLAN實驗報告

實驗要求&#xff1a; 實驗參考圖&#xff1a; 實驗過程&#xff1a; r1: [r1]int g 0/0/0.1 [r1-GigabitEthernet0/0/0.1]ip address 192.168.1.1 24 [r1-GigabitEthernet0/0/0.1]dot1q termination vid 2 [r1-GigabitEthernet0/0/0.1]arp broadcast enable [r1]int g 0/0/…

Mysql學習之MVCC解決讀寫問題

多版本并發控制 什么是MVCC MVCC &#xff08;Multiversion Concurrency Control&#xff09;多版本并發控制。顧名思義&#xff0c;MVCC是通過數據行的多個版本管理來實現數據庫的并發控制。這項技術使得在InnoDB的事務隔離級別下執行一致性讀操作有了保證。換言之&#xff0…