import { createPinia } from "pinia";
import { createApp } from "vue";

import http from '@/api/index.js';
import icon from "@/icon/index.js";
import store from "@/stores/index.js";
import "@wangeditor/editor/dist/css/style.css"; // 引入 css
import "qweather-icons/font/qweather-icons.css";
import "tailwindcss/tailwind.css";
import "vfonts/FiraCode.css";
import VueWechatTitle from "vue-wechat-title";
import App from "./App.vue";
import "./assets/style/main.css";
import router from "./router/guard.js";
import { formatTimeBydate } from './util/index.js';



Date.prototype.format = formatTimeBydate
const app = createApp(App);

document.oncontextmenu = function () {
  return false;
};
app.use(createPinia());
app.use(router).use(VueWechatTitle);

window.$store = store
window.$http = http
// window.$icon = icon
for (const key in icon) {
  // console.log(key, icon[key]);
  app.component('icon-'+key, icon[key]);
}

app.mount("#app");
