perf: supplement login interface documents and add configuration parameters (#4175)

This commit is contained in:
Vben
2024-08-17 22:38:37 +08:00
committed by GitHub
parent 3c17f4e9f8
commit 5f41c51770
15 changed files with 234 additions and 71 deletions

View File

@@ -139,7 +139,7 @@ watch(
async (val) => {
if (val) {
await updateWatermark({
content: `${preferences.app.name} 用户名: ${userStore.userInfo?.username}`,
content: `${userStore.userInfo?.username}`,
});
}
},

View File

@@ -1,50 +0,0 @@
import { ref } from 'vue';
type El = HTMLElement | null | undefined;
export function useTabViewScroll(scrollDistance: number = 150) {
const scrollbarEl = ref<El>(null);
const scrollViewportEl = ref<El>(null);
function setScrollBarEl(el: El) {
scrollbarEl.value = el;
}
function setScrollViewEl(el: El) {
scrollViewportEl.value = el;
}
function getScrollClientWidth() {
if (!scrollbarEl.value || !scrollViewportEl.value) return {};
const scrollbarWidth = scrollbarEl.value.clientWidth;
const scrollViewWidth = scrollViewportEl.value.clientWidth;
return {
scrollbarWidth,
scrollViewWidth,
};
}
function scrollDirection(
direction: 'left' | 'right',
distance: number = scrollDistance,
) {
const { scrollbarWidth, scrollViewWidth } = getScrollClientWidth();
if (!scrollbarWidth || !scrollViewWidth) return;
if (scrollbarWidth > scrollViewWidth) return;
scrollViewportEl.value?.scrollBy({
behavior: 'smooth',
left: direction === 'left' ? -distance : +distance,
});
}
return {
scrollDirection,
setScrollBarEl,
setScrollViewEl,
};
}