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"
总结
提示:这里对文章进行总结: