// src/stores/authStore.js import { defineStore } from 'pinia'; export const useAuthStore = defineStore('auth', { state: () => ({ loginUser: null, key: null, }), getters: { // Vuex의 getters를 Pinia의 computed 속성처럼 사용합니다. getLoginUser: (state) => state.loginUser, getKey: (state) => state.key, }, actions: { // Vuex의 mutations과 actions을 Pinia에서는 하나의 `actions`로 합칩니다. setLoginUser(newValue) { this.loginUser = newValue; }, setKey(newValue) { this.key = newValue; }, }, });