0.0.6 • Published 2 years ago

copy-str v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

copy-str

  • Copy text using JavaScript

Install

pnpm install --save copy-str

Usage example

<script setip>
import copy from 'copy-str'
</script>

<template>
  <button class="container" onclick="copy('data')">
    copy
  </button>
</template>

argment

copy(data: string /*复制内容*/, options: Options /*可选参数*/): boolean
export type Type = 'success' | 'error' | 'warning' | 'info'
export interface Options {
  type: Type              // 弹窗样式
  showMessage?: boolean   // 是否显示弹窗
  duration?: number       // 出现时长
  message?: string        // 弹窗内文字
  offset?: number         // 弹窗距离顶部
  center?: boolean        // 文字居中
  showData?: boolean      // 显示复制内容
}

License

MIT License © 2022 Jeffrey

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago