国产chinesehdxxxx野外,国产av无码专区亚洲av琪琪,播放男人添女人下边视频,成人国产精品一区二区免费看,chinese丰满人妻videos

Electron clipboard 模塊

2019-08-14 19:22 更新

clipboard 模塊提供方法來供復制和粘貼操作 . 下面例子展示了如何將一個字符串寫道 clipboard 上:

const clipboard = require('electron').clipboard;
clipboard.writeText('Example String');

在 X Window 系統(tǒng)上, 有一個可選的 clipboard. 你可以為每個方法使用 selection 來控制它:

clipboard.writeText('Example String', 'selection');
console.log(clipboard.readText('selection'));

方法

clipboard 模塊有以下方法:

注意: 測試 APIs 已經標明,并且在將來會被刪除 .

clipboard.readText([type])

  • type String (可選)

以純文本形式從 clipboard 返回內容 .

clipboard.writeText(text[, type])

  • text String
  • type String (可選)

以純文本形式向 clipboard 添加內容 .

clipboard.readHtml([type])

  • type String (可選)

返回 clipboard 中的標記內容.

clipboard.writeHtml(markup[, type])

  • markup String
  • type String (可選)

向 clipboard 添加 markup 內容 .

clipboard.readImage([type])

  • type String (可選)

從 clipboard 中返回 NativeImage 內容.

clipboard.writeImage(image[, type])

向 clipboard 中寫入 image .

clipboard.readRtf([type])

  • type String (可選)

從 clipboard 中返回 RTF 內容.

clipboard.writeRtf(text[, type])

  • text String
  • type String (可選)

向 clipboard 中寫入 RTF 格式的 text .

clipboard.clear([type])

  • type String (可選)

清空 clipboard 內容.

clipboard.availableFormats([type])

  • type String (可選)

返回 clipboard 支持的格式數(shù)組 .

clipboard.has(data[, type]) Experimental

  • data String
  • type String (可選)

返回 clipboard 是否支持指定 data 的格式.

console.log(clipboard.has('<p>selection</p>'));

clipboard.read(data[, type]) Experimental

  • data String
  • type String (可選)

讀取 clipboard 的 data.

clipboard.write(data[, type])

  • data Object
  • type String (可選)
clipboard.write({text: 'test', html: "<b>test</b>"});

向 clipboard 寫入 data .

以上內容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號