| /** | ||
| * | ||
| * @param {*} text 复制内容 | ||
| */ | ||
| export function copyToClipboard(text) { | ||
| navigator.clipboard.writeText && navigator.clipboard.writeText(text) | ||
| } |
| const scrollToTop = (element) => | ||
| element.scrollIntoView({ behavior: "smooth", block: "start" }) | ||
| const scrollToBottom = (element) => | ||
| element.scrollIntoView({ behavior: "smooth", block: "end" }) |
+7
-16
@@ -1,19 +0,10 @@ | ||
| let data = { | ||
| getStr() { | ||
| console.log('我是一个注册包') | ||
| }, | ||
| // 时间戳为10位需*1000,时间戳为13位的话不需乘1000 | ||
| getTime(time, label) { | ||
| let date = new Date(time); | ||
| let Y = date.getFullYear() + label; | ||
| let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + label; | ||
| let D = date.getDate() + ' '; | ||
| let h = date.getHours() + ':'; | ||
| let m = date.getMinutes() + ':'; | ||
| let s = date.getSeconds(); | ||
| return Y + M + D + h + m + s; | ||
| } | ||
| import { time } from './lib/time' | ||
| import { copy } from './lib/copy' | ||
| let featched = { | ||
| getTime = time.getTime, | ||
| getCory = copy.copyToClipboard | ||
| } | ||
| module.exports = data | ||
| module.exports = featched |
+1
-1
| { | ||
| "name": "featched", | ||
| "version": "1.0.1", | ||
| "version": "1.0.2", | ||
| "description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+9
-0
@@ -0,1 +1,10 @@ | ||
| ## 时间戳转换 | ||
| getTime(时间戳,间隔字符) 时间戳为10位需*1000,时间戳为13位的话不需乘1000 | ||
| ## 复制到剪贴板 | ||
| getCory(文本内容) | ||
| $ npm install |
1518
81.15%6
50%30
87.5%10
900%