dev
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
import {defineStore} from 'pinia'
|
||||
|
||||
const config = defineStore('config', ()=>{
|
||||
})
|
||||
@@ -1,12 +0,0 @@
|
||||
import { ref, computed } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useCounterStore = defineStore('counter', () => {
|
||||
const count = ref(0)
|
||||
const doubleCount = computed(() => count.value * 2)
|
||||
function increment() {
|
||||
count.value++
|
||||
}
|
||||
|
||||
return { count, doubleCount, increment }
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
import { createPinia } from "pinia"
|
||||
|
||||
export * from "./info"
|
||||
|
||||
export const pinia = createPinia()
|
||||
@@ -0,0 +1,29 @@
|
||||
import api from "@/api"
|
||||
import type { ICharacterInfo } from "@/api/info/type"
|
||||
import { defineStore } from "pinia"
|
||||
|
||||
export const useInfoStore = defineStore("infoStore", ()=>{
|
||||
|
||||
const token = ref<string>("")
|
||||
const infos = ref<ICharacterInfo | null>(null)
|
||||
|
||||
const skills = computed(()=>infos.value?.skills ?? [])
|
||||
|
||||
const equips = computed(()=>infos.value?.equips ?? [])
|
||||
|
||||
const suits = computed(()=>infos.value?.suits ?? [])
|
||||
|
||||
const createCharacter = async (alter: string, equVersion?: string) => {
|
||||
token.value = await api.createToken(alter, equVersion)
|
||||
infos.value = await api.characterInfo()
|
||||
}
|
||||
|
||||
return {
|
||||
token,
|
||||
infos,
|
||||
skills,
|
||||
equips,
|
||||
suits,
|
||||
createCharacter,
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user