feat: migrate to vue 3 (#2689)
--------- Co-authored-by: Joep <jcbuhre@gmail.com> Co-authored-by: Omar Hussein <omarmohammad1951@gmail.com> Co-authored-by: Oleg Lobanov <oleg@lobanov.me>
This commit is contained in:
24
frontend/src/stores/clipboard.ts
Normal file
24
frontend/src/stores/clipboard.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
export const useClipboardStore = defineStore("clipboard", {
|
||||
// convert to a function
|
||||
state: (): {
|
||||
key: string;
|
||||
items: ClipItem[];
|
||||
path?: string;
|
||||
} => ({
|
||||
key: "",
|
||||
items: [],
|
||||
path: undefined,
|
||||
}),
|
||||
getters: {
|
||||
// user and jwt getter removed, no longer needed
|
||||
},
|
||||
actions: {
|
||||
// no context as first argument, use `this` instead
|
||||
// easily reset state using `$reset`
|
||||
resetClipboard() {
|
||||
this.$reset();
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user