Comments (15)
请确保是修改的webpack打包主进程的配置,你有可能是修改的渲染进程的代码
from screenshots.
请确保是修改的webpack打包主进程的配置,你有可能是修改的渲染进程的代码
vue.config.js
chainWebpack: (config) => {
Object.assign(config,{
externals: {
'shortcut-capture': "shortcut-capture"
}
})
},
configureWebpack: {
externals: {
'shortcut-capture': "shortcut-capture"
}
},
const shortcutCapture = new ShortcutCapture({ isUseClipboard: true})
打印 shortcutCapture,shortcutCapture.shortcutCapture
得到
shortcutCapture: c {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
'$win': null
}
shortcutCapture.shortcutCapture: [Function: shortcutCapture]
这个方法是有的啊
from screenshots.
我的是mac端。
from screenshots.
这个方法是一定有的,但是由于截图插件要加载html页面,所以是html页面加载失败了,你可以在主进程中使用require.resolve去加载一下插件,看看路径是不是位于node_mudules下的
from screenshots.
https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/configuration.html#webpack-configuration
from screenshots.
我在electron-vue中,能正常使用,但是在Vue CLI Plugin Electron Builder
这个我有在主进程中试过,而且多种都尝试过;还是没起作用。
代码如:
pluginOptions: {
electronBuilder: {
chainWebpackMainProcess: config => {
Object.assign(config, {
externals: ['shortcut-capture']})
return config
},
}
},
pluginOptions: {
electronBuilder: {
chainWebpackMainProcess: config => {
Object.assign(config, {
externals: {
'shortcut-capture':"require('shortcut-capture')"
}
})
return config
},
}
},
pluginOptions: {
electronBuilder: {
chainWebpackMainProcess: config => {
return{
externals: {
'shortcut-capture':"require('shortcut-capture')"
}
}
},
}
},
from screenshots.
https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/configuration.html#webpack-configuration
上面都尝试了,还是不行
from screenshots.
你注意看一下文档,请使用链式调用去修改webpack配置
from screenshots.
你注意看一下文档,请使用链式调用去修改webpack配置
这个配置不一定要链式,但是用链式的也是同样的情况,无法使用。
from screenshots.
config.externals({'shortcut-capture':"require('shortcut-capture')"})
from screenshots.
问题解决了吗?我这里使用vue-cli-plugin-electron-builder配置了一个,没有问题,仓库:https://github.com/nashaofu/vue-cli-plugin-electron-builder-issue
from screenshots.
问题解决了吗?我这里使用vue-cli-plugin-electron-builder配置了一个,没有问题,仓库:https://github.com/nashaofu/vue-cli-plugin-electron-builder-issue
在windows端 下载下来是有效的,mac端还是无效。 但是在electron-vue项目中,mac端是有效的。
from screenshots.
from screenshots.
我就是在mac上测试可用的 在 2019年8月29日,10:39,MrZhangbing <[email protected]mailto:[email protected]> 写道: 问题解决了吗?我这里使用vue-cli-plugin-electron-builder配置了一个,没有问题,仓库:https://github.com/nashaofu/vue-cli-plugin-electron-builder-issue 在windows端 下载下来是有效的,mac端还是无效。 但是在electron-vue项目中,mac端是有效的。 — You are receiving this because you commented. Reply to this email directly, view it on GitHub<#18?email_source=notifications&email_token=AETIVES4Z7BE6O4TNCYWCFDQG4ZGLA5CNFSM4IO3HNCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5NBH7Q#issuecomment-525997054>, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AETIVEQTHAWBVIEOGSA5JI3QG4ZGLANCNFSM4IO3HNCA.
我试了下,别人的mac也是可以的 ,我的mac怎么试都不行。
from screenshots.
const externals = {
'shortcut-capture' : 'require("shortcut-capture")',
};
config.externals(externals);
Above Config would be useless when you execute electron:build
to pack app
I slove this problem by config like this
electronBuilder : {
externals : [ 'shortcut-capture' ],
// ....
}
it runs fine
from screenshots.
Related Issues (20)
- mac端打包后每次截图都会弹出屏幕录制权限提示,而且除了当前应用其他应用被隐藏 HOT 4
- 打包在window上正常,但打包到在linux arm点击无效 HOT 4
- 0.5.20升级0.5.21后,linux(统信)截图时无法触发screenshots.$win.on('focus') HOT 1
- 找不到`node-screenshots.win32-x64-msvc.node`文件 HOT 6
- 希望能像微信QQ一样能默认选中窗口 HOT 1
- 在electron-vite里使用无法使用 HOT 6
- 在触摸屏下无法使用。。。
- 能支持windows端跨屏载图吗 HOT 1
- electron 工程主进程打包使用webpack 设置了externals,electron-forge 打出包后运行报错 HOT 1
- electron style cursor
- 关于该插件优化建议 HOT 1
- vite-electron-vue3-ts项目,本地使用正常,打包后报错 HOT 7
- 升级到0.5.24(及以上)后报错:UnhandledPromiseRejectionWarning: TypeError: Screenshots is not a constructor HOT 2
- 内存得不到释放 HOT 1
- [Mac] startCapture后 Command+Tab快捷键仍然起作用
- windows上,先hide窗口再截图,会截到窗口的虚影,监听窗口hide事件再截图也无效 HOT 3
- 截图后事件回调都不触发,粘贴到微信或者qq是可以获取到所截图片的
- 成功回调screenshots.on会随着裁切的次数进行累积的触发 HOT 2
- win 10 截取 前需先隐藏窗口,我使用win.hide() 后截图依然显示窗口
- 使用提供的esc 关闭截图方法后,其余应用程序esc 都失效了 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from screenshots.