新增收银页面
This commit is contained in:
37
src/main.js
37
src/main.js
@@ -5,28 +5,33 @@ import ElementPlus from "element-plus";
|
||||
import zhCn from "element-plus/es/locale/lang/zh-cn";
|
||||
import "element-plus/dist/index.css";
|
||||
import "element-plus/theme-chalk/dark/css-vars.css";
|
||||
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
||||
import store from "./store";
|
||||
|
||||
let matchMedia = window.matchMedia("(prefers-color-scheme: light)");
|
||||
setDarkMode(matchMedia.matches);
|
||||
matchMedia.addEventListener("change", function () {
|
||||
console.log(`当前的主题是:${this.matches ? "light" : "dark"}`);
|
||||
setDarkMode(this.matches);
|
||||
});
|
||||
// let matchMedia = window.matchMedia("(prefers-color-scheme: light)");
|
||||
// setDarkMode(matchMedia.matches);
|
||||
// matchMedia.addEventListener("change", function () {
|
||||
// console.log(`当前的主题是:${this.matches ? "light" : "dark"}`);
|
||||
// setDarkMode(this.matches);
|
||||
// });
|
||||
|
||||
// 设置主题模式
|
||||
function setDarkMode(flag) {
|
||||
if (flag) {
|
||||
document.querySelector("#html").classList.add("light");
|
||||
document.querySelector("#html").classList.remove("dark");
|
||||
} else {
|
||||
document.querySelector("#html").classList.add("dark");
|
||||
document.querySelector("#html").classList.remove("light");
|
||||
}
|
||||
}
|
||||
// // 设置主题模式
|
||||
// function setDarkMode(flag) {
|
||||
// if (flag) {
|
||||
// document.querySelector("#html").classList.add("light");
|
||||
// document.querySelector("#html").classList.remove("dark");
|
||||
// } else {
|
||||
// document.querySelector("#html").classList.add("dark");
|
||||
// document.querySelector("#html").classList.remove("light");
|
||||
// }
|
||||
// }
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||
app.component(key, component)
|
||||
}
|
||||
|
||||
app.use(router);
|
||||
app.use(store);
|
||||
app.use(ElementPlus, { locale: zhCn });
|
||||
|
||||
Reference in New Issue
Block a user