Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bmiss-fans
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangtao
bmiss-fans
Commits
d0d1cfc1
Commit
d0d1cfc1
authored
Jan 22, 2026
by
wangtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多语言图片
parent
75ea1be6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
showImage.ts
src/directives/showImage.ts
+7
-7
Index.vue
src/views/index/Index.vue
+1
-1
No files found.
src/directives/showImage.ts
View file @
d0d1cfc1
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* 这是一个图片展示的指令,用于在ios14及以下展示png类型的图片,ios14以上使用webp类型的图片, 安卓一律使用webp类型的图片
* 这是一个图片展示的指令,用于在ios14及以下展示png类型的图片,ios14以上使用webp类型的图片, 安卓一律使用webp类型的图片
*/
*/
import
{
Directive
,
DirectiveBinding
}
from
"vue"
;
import
{
Directive
,
DirectiveBinding
}
from
"vue"
;
import
handleApp
from
"@/utils/HandleApp"
;
//
import handleApp from "@/utils/HandleApp";
import
{
getLocale
}
from
"@/locales/locale"
;
import
{
getLocale
}
from
"@/locales/locale"
;
const
ENV
=
import
.
meta
.
env
;
const
ENV
=
import
.
meta
.
env
;
...
@@ -44,12 +44,12 @@ const handleImg = ({ ele, src, onError }: HandleImg) => {
...
@@ -44,12 +44,12 @@ const handleImg = ({ ele, src, onError }: HandleImg) => {
ele
.
src
=
`
${
baseDir
}
/
${
dirPath
}
/enpng/
${
fileName
}
.png`
;
ele
.
src
=
`
${
baseDir
}
/
${
dirPath
}
/enpng/
${
fileName
}
.png`
;
}
else
{
}
else
{
if
(
handleApp
.
agent
===
"ios"
&&
handleApp
.
iosVersion
.
minorVersion
<
14
)
{
ele
.
src
=
`
${
baseDir
}
/
${
dirPath
}
/png/
${
fileName
}
.png`
;
ele
.
src
=
`
${
baseDir
}
/
${
dirPath
}
/png/
${
fileName
}
.png`
;
}
else
{
// if (handleApp.agent === "ios" && handleApp.iosVersion.minorVersion < 14) {
ele
.
src
=
`
${
baseDir
}
/
${
dirPath
}
/webp/
${
fileName
}
.webp`
;
// ele.src = `${baseDir}/${dirPath}/png/${fileName}.png`;
}
// } else {
// ele.src = `${baseDir}/${dirPath}/webp/${fileName}.webp`;
// }
}
}
ele
.
onerror
=
onError
;
ele
.
onerror
=
onError
;
...
...
src/views/index/Index.vue
View file @
d0d1cfc1
...
@@ -37,7 +37,7 @@ import HandleApp from "@/utils/HandleApp";
...
@@ -37,7 +37,7 @@ import HandleApp from "@/utils/HandleApp";
> .shell
> .shell
width 100%
width 100%
height
75
%
height
100
%
> .boost
> .boost
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment