mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-08-06 10:57:26 +08:00
- 在多个组件中将 require 替换为 import,提升代码可读性和一致性。 - 在 App.vue 中添加分类树的 API 请求,优化分类数据的加载逻辑。 - 更新样式以适配 Element Plus 组件,确保界面一致性。 - 删除不再使用的样式文件,简化项目结构。
62 lines
1.1 KiB
Vue
62 lines
1.1 KiB
Vue
<template>
|
|
<div id="main" class="app-main">
|
|
<router-view />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import Cookies from "js-cookie";
|
|
import util from "@/libs/util";
|
|
import { getCategoryTree } from "@/api/goods.js";
|
|
|
|
export default {
|
|
name: "App",
|
|
mounted() {
|
|
const loggedIn =
|
|
this.getStore("accessToken") || Cookies.get("userInfoSeller");
|
|
if (loggedIn) {
|
|
util.bootstrapDynamicRoutesFromCache();
|
|
util.initRouter(this);
|
|
this.$store.commit("setOpenedList");
|
|
this.$store.commit("initCachepage");
|
|
if (!localStorage.getItem("category")) {
|
|
getCategoryTree().then((res) => {
|
|
if (res.success && Array.isArray(res.result)) {
|
|
localStorage.setItem("category", JSON.stringify(res.result));
|
|
}
|
|
});
|
|
}
|
|
}
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style>
|
|
html,
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: #f0f0f0;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.app-main {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
.br button {
|
|
margin-right: 5px;
|
|
}
|
|
|
|
.operation button {
|
|
margin-right: 5px;
|
|
}
|
|
|
|
.tox-notifications-container {
|
|
display: none !important;
|
|
}
|
|
</style>
|