【无标题】

Electron13 + Vue3 + C++.Dll + Sqlite3


前言


提示:以下是本篇文章正文内容,下面案例可供参考

一、使用步骤

1.Vue

vue create ele-vue

2.Electron

vue add electron-builder

屏蔽安装devtool

app.on('ready', async () => {
  // if (isDevelopment && !process.env.IS_TEST) {
  //   // Install Vue Devtools
  //   try {
  //     await installExtension(VUEJS3_DEVTOOLS)
  //   } catch (e) {
  //     console.error('Vue Devtools failed to install:', e.toString())
  //   }
  // }
  createWindow()
})

3.cnpm

cnpm install -g cnpm --registry=https://registry.npm.taobao.org

4.node-gyp

cnpm install node-gyp -g

5.windows-build-tools

cnpm install windows-build-tools -g

很久都没有安装完成的话
根据

npm config set msvs_version 2015

6.ffi-napi

npm install ffi-napi --save
npm install node-polyfill-webpack-plugin 
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
pluginOptions: {
  // vue-cli-plugin-electron-builder 配置
  electronBuilder: {
    nodeIntegration:true,
    externals:['ffi-napi'],
  }
},
configureWebpack: {
  externals: {
    'electron': 'require("electron")'
  },
 plugins: [new NodePolyfillPlugin()],
},

7.sqlite3

npm install sqlite3 --save

8.sqlcipher

npm install "@journeyapps/sqlcipher"

总结

提示:这里对文章进行总结:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值