refactor: ♻️ 移除 log 和完善 mock 接口

This commit is contained in:
hxr
2024-01-10 23:43:59 +08:00
parent a7233960e3
commit 06c448ebbc
10 changed files with 970 additions and 140 deletions

View File

@@ -79,7 +79,6 @@ const tagsViewStore = useTagsViewStore();
const appStore = useAppStore();
const { visitedViews } = storeToRefs(tagsViewStore);
console.log("visitedViews", visitedViews);
const settingsStore = useSettingsStore();
const layout = computed(() => settingsStore.layout);
@@ -142,14 +141,11 @@ function filterAffixTags(routes: RouteRecordRaw[], basePath = "/") {
let tags: TagView[] = [];
routes.forEach(processRoute);
console.log("filterAffixTags", tags);
return tags;
}
function initTags() {
const tags: TagView[] = filterAffixTags(permissionStore.routes);
console.log("initTags", tags);
affixTags.value = tags;
for (const tag of tags) {
// Must have tag name
@@ -160,7 +156,6 @@ function initTags() {
}
function addTags() {
console.log("addTags", visitedViews);
if (route.meta.title) {
tagsViewStore.addView({
name: route.name as string,
@@ -174,7 +169,6 @@ function addTags() {
}
function moveToCurrentTag() {
console.log("moveToCurrentTag", visitedViews);
// 使用 nextTick() 的目的是确保在更新 tagsView 组件之前scrollPaneRef 对象已经滚动到了正确的位置。
nextTick(() => {
for (const tag of visitedViews.value) {