// src/stores/fontSizeStore.js
import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useFontSizeStore = defineStore('fontSize', () => {
    const scale = ref(parseFloat(localStorage.getItem('fontScale')) || 1.2)

    const updateScale = (val) => {
        scale.value = val
        localStorage.setItem('fontScale', val)
        // 可以在这里动态修改全局字体大小，例如：
        document.documentElement.style.fontSize = `${16 * val}px`
    }

    return {
        scale,
        updateScale
    }
})
