拓展Electron的剪切板

Posted 十木禾

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了拓展Electron的剪切板相关的知识,希望对你有一定的参考价值。

拓展Electron的剪切板

A better clipboard for Electron (NodeJS).

Install

npm i better-clipboard

electron-rebuild -f -w better-clipboard

Usage

import  betterClipboard  from 'better-clipboard';

betterClipboard.readFilePathList(); // get the path of file which in clipboard
betterClipboard.readBufferList();
betterClipboard.readFileList();


betterClipboard.writeFileList([]); // write file into clipboard via file path

Webpack

If you are using webpack, simply add better-clipboard into externals:

  config.externals = 
    'better-clipboard': 'commonjs better-clipboard'
  

Hope you have a better experience when using clipboard in electron.

Github

https://github.com/simo-an/better-clipboard

以上是关于拓展Electron的剪切板的主要内容,如果未能解决你的问题,请参考以下文章

拓展Electron的剪切板

拓展Electron的剪切板

拓展Electron的剪切板

APP推荐:JSBox

剪切板操作

复制MFC文本框内容到剪切板方法?