|
@@ -1,5 +1,6 @@
|
|
import { defineStore } from "pinia";
|
|
import { defineStore } from "pinia";
|
|
import piniaPersistConfig from "@/config/piniaPersist";
|
|
import piniaPersistConfig from "@/config/piniaPersist";
|
|
|
|
+import { generateUUID } from "@/utils";
|
|
|
|
|
|
type ClipboardItem<T = any> = {
|
|
type ClipboardItem<T = any> = {
|
|
key?: string;
|
|
key?: string;
|
|
@@ -26,7 +27,7 @@ export const useClipboardStore = defineStore("clipboard", {
|
|
id?: string;
|
|
id?: string;
|
|
} = {}
|
|
} = {}
|
|
) {
|
|
) {
|
|
- const { key = "default", id = crypto.randomUUID() } = options;
|
|
|
|
|
|
+ const { key = "default", id = generateUUID() } = options;
|
|
|
|
|
|
// 自动清理旧记录
|
|
// 自动清理旧记录
|
|
if (this.items.length >= this.maxHistory) {
|
|
if (this.items.length >= this.maxHistory) {
|