当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript clipboard.isSupported函数代码示例

本文整理汇总了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 => { });
开发者ID:AbraaoAlves,项目名称:DefinitelyTyped,代码行数:28,代码来源:clipboard-tests.ts

示例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 => {});
开发者ID:BernieSumption,项目名称:DefinitelyTyped,代码行数:28,代码来源:clipboard-tests.ts

示例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 => {});
开发者ID:DavidM77,项目名称:DefinitelyTyped,代码行数:28,代码来源:clipboard-tests.ts


注:本文中的clipboard.isSupported函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。