本文整理汇总了TypeScript中clipboard.isSupported函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isSupported函数的具体用法?TypeScript isSupported怎么用?TypeScript isSupported使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isSupported函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: Clipboard
import * as Clipboard from 'clipboard';
const cb1 = new Clipboard('.btn');
const cb2 = new Clipboard(document.getElementById('id'), {
action: elem => 'copy'
});
const cb3 = new Clipboard(document.querySelectorAll('query'), {
text: elem => null
});
const cb4 = new Clipboard('.btn', {
target: elem => null
});
const cb5 = new Clipboard('.btn', {
action: elem => 'copy',
target: elem => null
});
cb1.destroy();
cb1.isSupported();
cb2.on('success', e => {
console.info('Action:', e.action);
console.info('Text:', e.text);
console.info('Trigger:', e.trigger);
e.clearSelection();
});
cb2.on('error', e => { });
示例2: ClipboardJS
import * as ClipboardJS from "clipboard";
const cb1 = new ClipboardJS(".btn");
const cb2 = new ClipboardJS(document.getElementById("id"), {
action: elem => "copy"
});
const cb3 = new ClipboardJS(document.querySelectorAll("query"), {
text: elem => null
});
const cb4 = new ClipboardJS(".btn", {
target: elem => null
});
const cb5 = new ClipboardJS(".btn", {
action: elem => "copy",
target: elem => null
});
cb1.destroy();
ClipboardJS.isSupported();
cb2.on("success", e => {
console.info("Action:", e.action);
console.info("Text:", e.text);
console.info("Trigger:", e.trigger);
e.clearSelection();
});
cb2.on("error", e => {});
示例3: Clipboard
import * as Clipboard from "clipboard";
const cb1 = new Clipboard(".btn");
const cb2 = new Clipboard(document.getElementById("id"), {
action: elem => "copy"
});
const cb3 = new Clipboard(document.querySelectorAll("query"), {
text: elem => null
});
const cb4 = new Clipboard(".btn", {
target: elem => null
});
const cb5 = new Clipboard(".btn", {
action: elem => "copy",
target: elem => null
});
cb1.destroy();
Clipboard.isSupported();
cb2.on("success", e => {
console.info("Action:", e.action);
console.info("Text:", e.text);
console.info("Trigger:", e.trigger);
e.clearSelection();
});
cb2.on("error", e => {});