use pinia to create tab store

This commit is contained in:
geoffrey45
2022-03-06 10:26:23 +03:00
parent eebe6b4440
commit 90f8703a8e
+21
View File
@@ -0,0 +1,21 @@
import { defineStore } from "pinia";
import { ref } from "vue";
const tablist = {
home: "home",
search: "search",
queue: "queue",
};
export default defineStore("tabs", {
state: () => ({
tabs: tablist,
current: tablist.home,
}),
actions: {
changeTab(tab) {
this.current = tab;
console.log(this.current);
},
},
});