Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-ui
Commits
264d47d5
提交
264d47d5
authored
12月 13, 2025
作者:
lidongxu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(water): 解决:water 水印在移动端滚动超出 100% 屏幕高度外的不显示水印问题,以及飞书客户端内不重复显示水印问题
上级
8cf67bd5
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
29 行增加
和
3 行删除
+29
-3
App.vue
src/App.vue
+26
-3
index.vue
src/views/mobile/pages/menu/index.vue
+3
-0
没有找到文件。
src/App.vue
浏览文件 @
264d47d5
<
template
>
<template
v-if=
"
!isInWhiteList
"
>
<template
v-if=
"
shouldShowWatermark
"
>
<el-watermark
:font=
"font"
:content=
"content"
class=
"wm-class"
>
class=
"wm-class"
:class=
"
{'wm-mobile-class': isMobile}">
<router-view
/>
</el-watermark>
</
template
>
...
...
@@ -16,13 +17,30 @@ import useSettingsStore from '@/store/modules/settings'
import
{
handleThemeStyle
}
from
'@/utils/theme'
import
useUserStore
from
'@/store/modules/user'
import
{
isWhiteList
}
from
'@/permission'
import
{
isMobile
}
from
'@/utils'
const
route
=
useRoute
()
/*************** 水印相关 *************** */
const
isInWhiteList
=
computed
(()
=>
isWhiteList
(
route
.
path
))
const
isInFeishu
=
computed
(()
=>
{
const
userAgent
=
navigator
.
userAgent
.
toLowerCase
()
// 检测飞书用户代理标识
return
userAgent
.
includes
(
'lark'
)
||
userAgent
.
includes
(
'feishu'
)
})
const
shouldShowWatermark
=
computed
(()
=>
{
// 既不在飞书也不在白名单则显示水印
return
!
isInWhiteList
.
value
&&
!
isInFeishu
.
value
})
// 水印显示内容
const
content
=
computed
(()
=>
{
return
useUserStore
().
userInfo
.
nickName
+
' '
+
useUserStore
().
userInfo
.
phonenumber
?.
substring
(
7
)
})
// 水印字体,暗黑模式切换水印文字颜色
const
isDark
=
computed
(()
=>
{
return
useSettingsStore
().
isDark
})
...
...
@@ -51,8 +69,13 @@ onMounted(() => {
<
style
scoped
lang=
"scss"
>
.wm-class
{
.wm-class
{
min-height
:
100%
;
height
:
100%
;
}
.wm-mobile-class
{
min-height
:
100%
;
height
:
auto
;
}
</
style
>
src/views/mobile/pages/menu/index.vue
浏览文件 @
264d47d5
...
...
@@ -43,6 +43,9 @@ const modules = ref([]); // 替换原有的静态modules
// 观察路由挂载后事件
// 格式化路由为菜单所需结构
const
formatRoutesToModules
=
(
routes
)
=>
{
// 把首页去除掉
// 把首页去除掉
routes
=
routes
.
filter
(
route
=>
route
.
path
!==
''
);
// 根据实际路由结构转换,这里假设需要提取一级路由作为模块
modules
.
value
=
routes
.
map
(
o
=>
{
return
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论