import { createApp } from "vue";
import "@unocss/reset/tailwind-compat.css";
import "./style.css";
import "uno.css";
import App from "./App.vue";
// Pinia 持久化
import store from "@/store/index";
//导入路由
import router from "@/router/index";

const app = createApp(App);

function setRootFontSize() {
    const screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
    const baseSize = 16; // 基准字体大小
    const scale = screenWidth / 375; // 设计稿宽度（通常为 375px）
    document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + 'px'; // 限制最大缩放比例
  }
  
  setRootFontSize();
  window.addEventListener('resize', setRootFontSize);

// 注册已经加上了持久化的pinia
app.use(store).use(router);

app.mount("#app");
