国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

vue vite ts electron ipc arm64

這篇具有很好參考價值的文章主要介紹了vue vite ts electron ipc arm64。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

環(huán)境

系統(tǒng):debian 12


初始化

vscode 安裝 TypeScript Vue Plugin (Volar)、Vue Language Features (Volar)、C/C++ 擴展

sudo apt install nodejs npm
sudo npm install -g cnpm --registry=https://registry.npm.taobao.org # 從淘寶鏡像安裝 cnpm,建議使用 cnpm 代替 npm,雖然下面是用 npm 做試例,除非 cnpm 會讓程序出錯

npm init vue # 全選 yes。End-to-End: Cypress

# 進入項目目錄后使用
npm i 
npm i electron electron-builder -D
npm i commander -D # 額外組件

electron

新建 plugins、src/electron 文件夾

添加 src/electron/background.ts

屬于主進程

ipcMain.on、ipcMain.handle 都用于主進程監(jiān)聽 ipc,ipcMain.on 用于監(jiān)聽 ipcRenderer.send,ipcMain.handle 用于監(jiān)聽 ipcRenderer.invoke 并 return xxx

ipc 單向:
從渲染進程發(fā)向主進程:ipcRenderer.send
從主進程發(fā)向渲染進程:window.webContents.send

ipc 雙向:
從渲染進程發(fā)向主進程,主進程還會返回發(fā)向渲染進程:ipcRenderer.invoke
從主進程發(fā)向渲染進程,渲染進程還會返回發(fā)向主進程:沒有類似于 ipcRenderer.invoke 的,需要間接實現(xiàn)。主進程使用 window.webContents.send,渲染進程使用 ipcRenderer.send

渲染進程之間的 ipc 通信:
這里沒寫此示例
讓主進程中轉(zhuǎn),也就是“渲染進程1”使用 ipcRenderer.send 到主進程的 ipcMain.on,然后主進程在這個 ipcMain.on 里用相應(yīng)的 window2.webContents.send 發(fā)送到“渲染進程2”里。每個 “const windowxxx = new BrowserWindow“ 就是一個新的渲染進程

import { app, BrowserWindow, screen, ipcMain } from 'electron'
import path from 'path'
import { Command } from 'commander'
import os from 'os'

// 當 electron 準備好時觸發(fā)
app.whenReady().then(() => {
  // 使用 c 編譯出的 .node
  try {
    var addon = require(`./addon/hello_${os.arch()}.node`)
    console.log(addon.hello())
  } catch (error) {
    console.log(error)
  }
  
  // 命令行參數(shù)解析
  // -m 則全屏
  // -l http://xxx:xxx 則加載該 url 的 index.html,可實時刷新頁面的更改,用于調(diào)試
  // -d 則打開開發(fā)者工具
  // 以下參數(shù)在某些情況下會使用,對用戶無實際功能,但不添加到 Command 會因參數(shù)錯誤而被強制退出
  // --no-sandbox root 用戶執(zhí)行 electron 應(yīng)用需要傳入此參數(shù)
  const command = new Command
  command
    .option('-m, --maximize', 'maximize window')
    .option('-l, --location <>', 'location of load index.html', './index.html')
    .option('-d, --dev', 'openDevTools')
    .option('--no-sandbox', 'other')
    .parse()

  const options = command.opts()

  // 創(chuàng)建窗口
  const window = new BrowserWindow({
    // -m
    width: options.maximize ? screen.getPrimaryDisplay().workAreaSize.width : 800,
    height: options.maximize ? screen.getPrimaryDisplay().workAreaSize.height : 600,

    autoHideMenuBar: true,
    webPreferences: {
      preload: path.join(__dirname, './preload.js') // 加載 預(yù)加載腳本,用于向渲染進程提供使用 ipc 通信的方法
    }
  })

  // -l http://xxx:xxx
  if (options.location.indexOf(':') >= 0)
    window.loadURL(options.location)
  else
    window.loadFile(options.location)

  // -d
  if (options.dev)
    window.webContents.openDevTools()

  // ipc 通信
  ipcMain.on('rtm', () => {
    console.log('rtm')
    window.webContents.send('mtr')
  })

  ipcMain.on('rtm_p', (e, p) => {
    console.log(p)
    window.webContents.send('mtr_p', `mtr_p ${p}`)
  })

  ipcMain.handle('rtmmtr_p', (e, p) => {
    console.log(p)
    return `rtmmtr_p ${p}`
  })

  ipcMain.handle('rtmmtr_hello', () => {
    return `${addon.hello()}`
  })
})

添加 src/electron/preload.ts

預(yù)加載腳本,用來給渲染進程提供使用 ipc 的方法
rtm 是渲染進程發(fā)向主進程;rtmmtr 是從渲染進程發(fā)向主進程,主進程還會返回發(fā)向渲染進程;mtr 是主進程發(fā)向渲染進程

import { contextBridge, ipcRenderer } from 'electron'

contextBridge.exposeInMainWorld('electronAPI', {
  rtm: () => ipcRenderer.send('rtm'),
  rtm_p: (p: any) => ipcRenderer.send('rtm_p', p),
  rtmmtr_p: (p: any) => ipcRenderer.invoke('rtmmtr_p', p),
  mtr: (p: any) => ipcRenderer.on('mtr', p),
  mtr_p: (p: any) => ipcRenderer.on('mtr_p', p),

  rtmmtr_hello: () => ipcRenderer.invoke('rtmmtr_hello'),
})

添加 src/electron/renderer.d.ts

給渲染進程用的 preload.ts 里的方法的類型聲明

export interface IElectronAPI {
  rtm: () => Promise<any>,
  rtm_p: (p: any) => Promise<any>,
  rtmmtr_p: (p: any) => Promise<any>,
  mtr: (p: any) => Promise<any>,
  mtr_p: (p: any) => Promise<any>,

  rtmmtr_hello: () => Promise<any>,
}

declare global {
  interface Window {
    electronAPI: IElectronAPI
  }
}

添加 plugins/vite.electron.dev.ts

自定義 dev 方法,用于啟動 vite 后帶起 electron

import type { Plugin } from 'vite'
import type { AddressInfo } from 'net'
import { spawn } from 'child_process'
import fs from 'fs'

// 導(dǎo)出 Vite 插件函數(shù)
export const viteElectronDev = (): Plugin => {
  return {
    name: 'vite-electron-dev',
    // 在 configureServer 中實現(xiàn)插件的邏輯
    configureServer(server) {
      // 定義初始化 Electron 的方法
      const initElectron = () => {
        // 使用 esbuild 編譯 TypeScript 代碼為 JavaScript
        require('esbuild').buildSync({
          entryPoints: ['src/electron/background.ts', 'src/electron/preload.ts'],
          bundle: true,
          outdir: 'dist',
          platform: 'node',
          external: ['electron']
        })

        // 復(fù)制 .node 文件
        try {
          fs.mkdirSync('dist/addon')
        } catch (error) { }

        const node_file_table: string[] = ['hello'] // 需要使用的 .node 文件

        node_file_table.every((v, i, a) => {
          try {
            fs.copyFileSync(`addon/${v}_x64/build/Release/${v}.node`, `dist/addon/${v}_x64.node`)
          } catch (error) { }

          try {
            fs.copyFileSync(`addon/${v}_arm64/build/Release/${v}.node`, `dist/addon/${v}_arm64.node`)
          } catch (error) { }
        })

      // 定義運行 electron 的方法
      const electron_run = (ip: string) => {
        initElectron()

        // 啟動 Electron 進程并添加相應(yīng)的命令行參數(shù)
        let electronProcess = spawn(require('electron'), ['dist/background.js', '-l ' + ip, '-d'])

        // 監(jiān)聽 Electron 進程的 stdout 輸出
        electronProcess.stdout?.on('data', (data) => {
          console.log(`${data}`)
        })

        return electronProcess
      }

      // 監(jiān)聽 Vite 的 HTTP 服務(wù)器的 listening 事件
      server?.httpServer?.once('listening', () => {
        // 獲取 HTTP 服務(wù)器的監(jiān)聽地址和端口號
        const address = server?.httpServer?.address() as AddressInfo
        const ip = `http://localhost:${address.port}`

        let electronProcess = electron_run(ip)

        // 監(jiān)聽主進程代碼的更改以自動編譯這些 .ts 并重啟 electron
        fs.watch('src/electron', () => {
          electronProcess.kill()
          electronProcess = electron_run(ip)
        })
      })
    }
  }
}

添加 plugins/vite.electron.build.ts

自定義 build 方法,這里打包了 linux 的 x64、arm64 的包

import type { Plugin } from 'vite'
import * as electronBuilder from 'electron-builder'
import fs from 'fs'

// 導(dǎo)出Vite插件函數(shù)
export const viteElectronBuild = (): Plugin => {
  return {
    name: 'vite-electron-build',

    // closeBundle 是 Vite 的一個插件鉤子函數(shù),用于在 Vite 構(gòu)建完成后執(zhí)行一些自定義邏輯。
    closeBundle() {
      // 定義初始化 Electron 的函數(shù)
      const initElectron = () => {
        // 使用 esbuild 編譯 TypeScript 代碼為 JavaScript
        require('esbuild').buildSync({
          entryPoints: ['src/electron/background.ts', 'src/electron/preload.ts'],
          bundle: true,
          outdir: 'dist',
          platform: 'node',
          external: ['electron']
        })

        // 復(fù)制 .node 文件
        try {
          fs.mkdirSync('dist/addon')
        } catch (error) { }
        
        const node_file_table: string[] = [] // 需要使用的 .node 文件

        node_file_table.every((v, i, a) => {
          try {
            fs.copyFileSync(`addon/${v}_x64/build/Release/${v}.node`, `dist/addon/${v}_x64.node`)
          } catch (error) { }

          try {
            fs.copyFileSync(`addon/${v}_arm64/build/Release/${v}.node`, `dist/addon/${v}_arm64.node`)
          } catch (error) { }
        })
      }

      initElectron()

      // 修改 package.json 文件的 main 字段,不然打包失敗
      const json = JSON.parse(fs.readFileSync('package.json', 'utf-8'))
      json.main = 'background.js'
      fs.writeSync(fs.openSync('dist/package.json', 'w'), JSON.stringify(json, null, 2))

      // 創(chuàng)建空的 node_modules,避免自動復(fù)制一堆沒用的 node_modules,降低空間占用
      try {
        fs.mkdirSync('dist/node_modules')
      } catch (error) { }

      // 使用 electron-builder 打包
      electronBuilder.build({
        config: {
          appId: 'com.example.app',
          productName: 'vite-electron',
          directories: {
            app: "dist", // 被打包的散文件目錄
            output: "release", // 生成的包的目錄
          },

          // 無法跨操作系統(tǒng)打包
          // linux
          linux: {
            "target": [
              {
                "target": "AppImage", // 免安裝 .AppImage
                "arch": ["x64", "arm64"] // 會對每個架構(gòu)都會生成對應(yīng)的包。會下載對應(yīng)架構(gòu)的 electron,可能會下載失敗,多試幾次
              }
            ]
          },

          // windows
          win: {
            "target": [
              {
                "target": "portable", // 免安裝 .exe
                "arch": ["x64"]
              }
            ]
          }
        }
      })
    }
  }
}

修改頁面 src/App.vue

添加按鈕和 ipc
屬于渲染進程

window.electronAPI.xxx() 就是預(yù)加載腳本(preload.ts)給渲染進程提供的使用 ipc 的方法
window.electronAPI.mtr 和 …mtr_p (mtr:main to renderer)用于監(jiān)聽主進程發(fā)過來的消息
由于 window.electronAPI.rtmmtr_p 使用 ipcRenderer.invoke,這是異步方法,如果不在其前面加 await 而直接獲取會得到一個用于異步執(zhí)行的對象(Promise),其內(nèi)容包含了需要異步執(zhí)行的東西,await 就是等待該對象運行結(jié)束從而獲取正確值,而 await 需要其調(diào)用者是異步的,所以 increment() 也加上了 async(異步標志)

<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
import HelloWorld from './components/HelloWorld.vue'
import { ref } from 'vue'

// 響應(yīng)式狀態(tài)
const count = ref(0)

// 用來修改狀態(tài)、觸發(fā)更新的函數(shù)
async function increment() {
  count.value++
  window.electronAPI.rtm()
  window.electronAPI.rtm_p(`rtm_p ${count.value}`)
  const rtmmtr_p = await window.electronAPI.rtmmtr_p(`rtmmtr_p ${count.value}`)

  console.log(rtmmtr_p)
}

window.electronAPI.mtr(() => {
  console.log('mtr')
})

window.electronAPI.mtr_p((e: any, p: any) => {
  console.log(p)
})

async function increment_2() {
  hello.value = await window.electronAPI.rtmmtr_hello()
}
</script>

<template>
  <button @click="increment">hhh: {{ count }}</button>
  <button @click="increment_2">hello {{ hello }}</button>

  <header>
    <img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" />

    <div class="wrapper">
      <HelloWorld msg="You did it!" />

      <nav>
        <RouterLink to="/">Home</RouterLink>
        <RouterLink to="/about">About</RouterLink>
      </nav>
    </div>
  </header>

  <RouterView />
</template>

<style scoped>
header {
  line-height: 1.5;
  max-height: 100vh;
}

.logo {
  display: block;
  margin: 0 auto 2rem;
}

nav {
  width: 100%;
  font-size: 12px;
  text-align: center;
  margin-top: 2rem;
}

nav a.router-link-exact-active {
  color: var(--color-text);
}

nav a.router-link-exact-active:hover {
  background-color: transparent;
}

nav a {
  display: inline-block;
  padding: 0 1rem;
  border-left: 1px solid var(--color-border);
}

nav a:first-of-type {
  border: 0;
}

@media (min-width: 1024px) {
  header {
    display: flex;
    place-items: center;
    padding-right: calc(var(--section-gap) / 2);
  }

  .logo {
    margin: 0 2rem 0 0;
  }

  header .wrapper {
    display: flex;
    place-items: flex-start;
    flex-wrap: wrap;
  }

  nav {
    text-align: left;
    margin-left: -1rem;
    font-size: 1rem;

    padding: 1rem 0;
    margin-top: 1rem;
  }
}
</style>

修改配置 tsconfig.node.json

添加 “plugins/**/*.ts”

{
  "extends": "@tsconfig/node18/tsconfig.json",
  "include": [
    "vite.config.*",
    "vitest.config.*",
    "cypress.config.*",
    "nightwatch.conf.*",
    "playwright.config.*",
    "plugins/**/*.ts"
  ],
  "compilerOptions": {
    "composite": true,
    "module": "ESNext",
    "types": ["node"]
  }
}

修改配置 vite.config.ts

添加 plugins

import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'

// plugins
import { viteElectronDev } from './plugins/vite.electron.dev'
import { viteElectronBuild } from './plugins/vite.electron.build'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    vueJsx(),
    viteElectronDev(),
    viteElectronBuild()
  ],
  base: './', //默認絕對路徑改為相對路徑 否則打包白屏
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  }
})

addon-napi

為了讓 electron 調(diào)用 c,將 c/c++ 編譯成 .node 文件給 nodejs 用
新建 addon/hello_x64 目錄

添加 .vscode/c_cpp_properties.json

此文件可以使用 vscode 的命令面板進行添加

{
  "configurations": [
    {
      "name": "Linux",
      "includePath": [
        "${workspaceFolder}/**",
        "/usr/include/**"
      ],
      "defines": [],
      "compilerPath": "/usr/bin/gcc",
      "cStandard": "c17",
      "cppStandard": "gnu++17",
      "intelliSenseMode": "linux-gcc-x64"
    }
  ],
  "version": 4
}

添加 addon/hello_x64/hello.c

#include <assert.h>
#include <node_api.h>

static napi_value Method(napi_env env, napi_callback_info info) {
  napi_status status;
  napi_value world;
  status = napi_create_string_utf8(env, "world !", 7, &world);
  assert(status == napi_ok);
  return world;
}

#define DECLARE_NAPI_METHOD(name, func)                                        \
  { name, 0, func, 0, 0, 0, napi_default, 0 }

static napi_value Init(napi_env env, napi_value exports) {
  napi_status status;
  napi_property_descriptor desc = DECLARE_NAPI_METHOD("hello", Method);
  status = napi_define_properties(env, exports, 1, &desc);
  assert(status == napi_ok);
  return exports;
}

NAPI_MODULE(NODE_GYP_MODULE_NAME, Init)

添加 addon/hello_x64/hello.js

var addon = require('./build/Release/hello.node')

console.log(addon.hello())

添加 addon/hello_x64/binding.gyp

{
  "targets": [
    {
      "target_name": "hello",
      "sources": [ "hello.c" ]
    }
  ]
}

.node 的編譯與測試

cd 到 addon/hello_x64

sudo npm i -g node-gyp # 全局安裝 node-gyp
node-gyp configure # 生成 Makefile 文件
node-gyp build # 編譯
node ./hello.js # 測試,會輸出 world !

arm64 .node

.node 模塊必須要是對應(yīng)的 cpu 架構(gòu)
復(fù)制 addon/hello_x64 目錄為 addon/hello_arm64

cd 到 addon/hello_arm64

node-gyp configure --arch=arm64

將這些復(fù)制到 addon/hello/build/Makefile 的開頭:

cross_compiler = aarch64-linux-gnu-
CC = $(cross_compiler)gcc
CXX = $(cross_compiler)g++
LINK = $(CXX)
AR = $(cross_compiler)ar

編譯:

node-gyp build

使用

啟動:npm run dev
打包:npm run build

npm run dev后會在桌面出現(xiàn)應(yīng)用界面,并自動打開開發(fā)者工具,命令行會輸出 world。
修改 src/electron 下的任何文件都會自動編譯這些 .ts 并重啟 electron

npm run build 后會在 release 下生成 vite-electron-0.0.0.AppImage 和 vite-electron-0.0.0-arm64.AppImage。首次打包會下載 https://github.com/electron/electron/releases/download/v25.5.0/electron-v25.5.0-linux-x64.zip 和 electron-v25.5.0-linux-arm64.zip,如果網(wǎng)絡(luò)不好就多試幾次,或者下載好放到 ~/.cache/electron/ 下文章來源地址http://www.zghlxwxcb.cn/news/detail-615115.html


其他

  • https://xiaoman.blog.csdn.net/article/details/131713875?spm=1001.2014.3001.5502
  • https://www.electronjs.org/zh/docs/latest/tutorial/context-isolation
  • https://www.electronjs.org/zh/docs/latest/tutorial/ipc

到了這里,關(guān)于vue vite ts electron ipc arm64的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔相關(guān)法律責任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • electron+Vue3構(gòu)建桌面應(yīng)用之IPC通訊

    最近在做一個C/S架構(gòu)的項目預(yù)研 過程中遇到 Electron 與 Vue3 通訊的問題,費勁巴力的在網(wǎng)上找方案,發(fā)現(xiàn)都不理想,最終攻克之后,計劃將過程寫下來,供有需求的同學(xué)白嫖! 開始之前,先說一件重要的事情: 看文檔 看官方文檔 一定要看官方文檔 好,言歸正傳。 先說需求

    2024年04月29日
    瀏覽(22)
  • electron 生成 arm64 的包

    vue + electron:https://blog.csdn.net/qq1195566313/article/details/131713875 打包配置修改如下 會自動下載 https://github.com/electron/electron/releases/download/v25.3.1/electron-v25.3.1-linux-arm64.zip 并打包成 xxx-0.0.0-arm64.AppImage,和打 x64 的包一樣的步驟。

    2024年02月16日
    瀏覽(13)
  • vue3+vite在main.ts或者main.js文件中引入/App.vue報錯(/App.vue不是模塊)

    vue3+vite在main.ts或者main.js文件中引入/App.vue報錯(/App.vue不是模塊)

    vue3報錯提示 找不到模塊“/App.vue”或其相應(yīng)的類型聲明 在使用 vue3?vite?ts 或者 js 搭建前端框架時,在 main.ts 或者 main.js 中引入 /App.vue 報錯。報錯內(nèi)容為 /App.vue不是模塊 。下面我們分 vue3+js 和 vue3+ts 兩種情況討論,給出相應(yīng)的解決方案。 報錯顯示 : 報錯原因 :javascrip

    2024年01月25日
    瀏覽(93)
  • arm64架構(gòu)編譯electron長征路

    2024年01月21日
    瀏覽(25)
  • 交叉編譯ARM64架構(gòu)electron詳解

    交叉編譯ARM64架構(gòu)electron詳解

    本文主要參考Electron官方文檔中 構(gòu)建說明 和 構(gòu)建步驟(Linux) 在amd64環(huán)境內(nèi)構(gòu)建arm64的electron包。 如果是arm64環(huán)境請查看文章arm64架構(gòu)編譯electron長征路 操作系統(tǒng)版本:統(tǒng)信1060 操作系統(tǒng)架構(gòu):amd64 內(nèi)存:32G 如下圖: electron版本:v25.9.8 chromium版本:114.0.5735.289 由于llvm編譯需要

    2024年02月02日
    瀏覽(17)
  • electron 使用electron-packager打linux-x64包與linux-arm64包,解決打包緩慢問題

    electron 使用electron-packager打linux-x64包與linux-arm64包,解決打包緩慢問題

    使用electron-packager打linux-x64包與linux-arm64包,解決下載zip打包緩慢問題 在使用electron-packager打包的過程中,需要在第一次下載electron版本對應(yīng)的zip文件,下載很緩慢,而且還可能出現(xiàn)每次都在下載zip的情況 解決思路是提前下載好zip文件并修改electron—packager源碼將zip的路徑指定到

    2024年02月16日
    瀏覽(20)
  • 【Vue H5項目實戰(zhàn)】從0到1的自助點餐系統(tǒng)—— 搭建腳手架(Vue3.2 + Vite + TS + Vant + Pinia + Node.js)

    【Vue H5項目實戰(zhàn)】從0到1的自助點餐系統(tǒng)—— 搭建腳手架(Vue3.2 + Vite + TS + Vant + Pinia + Node.js)

    H5 項目基于 Web 技術(shù),可以在智能手機、平板電腦等移動設(shè)備上的瀏覽器中運行,無需下載和安裝任何應(yīng)用程序,且H5 項目的代碼和資源可以集中在服務(wù)器端進行管理,只需更新服務(wù)器上的代碼,即可讓所有顧客訪問到最新的系統(tǒng)版本。 本系列將以肯德基自助點餐頁面為模板

    2024年02月13日
    瀏覽(133)
  • electron+vue+ts窗口間通信

    electron+vue+ts窗口間通信

    現(xiàn)有場景: 用戶點擊圖,在新窗口展示實時數(shù)據(jù) vue作為純渲染線程不具備操作本地數(shù)據(jù)以及窗口間通訊的功能,必須由經(jīng)electron主進程解決. 因此官方為我們提供了IpcRederer向主進程發(fā)送消息的能力. 以及IpcMain主進程監(jiān)聽處理消息的能力. 由于ts和electron上下文隔離策略限制不允許直

    2024年02月14日
    瀏覽(12)
  • Vue3 Vite electron 開發(fā)桌面程序

    Vue3 Vite electron 開發(fā)桌面程序

    Electron是一個跨平臺的桌面應(yīng)用程序開發(fā)框架,它允許開發(fā)人員使用Web技術(shù)(如HTML、CSS和JavaScript)構(gòu)建桌面應(yīng)用程序,這些應(yīng)用程序可以在Windows、macOS和Linux等操作系統(tǒng)上運行。 Electron的核心是 Chromium 瀏覽器內(nèi)核和 Node.js 運行時環(huán)境。 Chromium 內(nèi)核提供了現(xiàn)代瀏覽器的功能,

    2024年02月16日
    瀏覽(17)
  • Vite + Vue3 + Electron實現(xiàn)進程通信

    Vite + Vue3 + Electron實現(xiàn)進程通信

    Electron 是一個基于 Chromium 和 Node.js 的桌面應(yīng)用程序開發(fā)框架,而 Vue3 則是一種流行的前端框架。將兩者結(jié)合使用可以快速地打造出跨平臺的桌面應(yīng)用程序。在這種組合中,Electron 提供了強大的桌面應(yīng)用開發(fā)能力,而 Vue3 則提供了易用的 UI 組件和開發(fā)體驗 Electron 內(nèi)置了 Chrom

    2024年02月12日
    瀏覽(22)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包