Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
R
rrpgLink_FrontEnd
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kesaubeeire
rrpgLink_FrontEnd
Commits
0af1634c
Commit
0af1634c
authored
Oct 21, 2023
by
KesaubeEire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 卡片图片路径错误重新引导.
parent
8635c2dd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
src/components/card.svelte
src/components/card.svelte
+21
-5
No files found.
src/components/card.svelte
View file @
0af1634c
<script>
<script>
import { toast } from '@zerodevx/svelte-toast';
import { _tagTrans } from '../stores';
import { _tagTrans } from '../stores';
/**父属性: 主标题*/
/**父属性: 主标题*/
...
@@ -46,10 +47,28 @@
...
@@ -46,10 +47,28 @@
fetch(folder + '/rpg_info/info.json', { method: 'GET' })
fetch(folder + '/rpg_info/info.json', { method: 'GET' })
.then(response => response.json())
.then(response => response.json())
.then(data => {
.then(data => {
console.log(data);
console.log(
title,
data);
// window.open(folder + '/rpg_info/' + data[1]);
// window.open(folder + '/rpg_info/' + data[1]);
});
});
}
}
/**图片错误处理*/
function picErrorHandler() {
_picError = true;
fetch(folder + '/rpg_info/info.json', { method: 'GET' })
.then(response => response.json())
.then(data => {
console.log('> 更正图片:\t', title, folder, data);
cover = folder + '/rpg_info/' + data[0];
// window.open(folder + '/rpg_info/' + data[1]);
})
.catch(err => {
cover = '/favicon.ico';
console.log(err);
toast.push(`Error报错:\t[${err.toString()}]`);
});
}
</script>
</script>
<div class="card w-80 bg-primary text-primary-content shadow-xl">
<div class="card w-80 bg-primary text-primary-content shadow-xl">
...
@@ -59,10 +78,7 @@
...
@@ -59,10 +78,7 @@
src={cover ?? '/favicon.ico'}
src={cover ?? '/favicon.ico'}
alt={title ?? 'default alt'}
alt={title ?? 'default alt'}
style={_picError ? 'height: 240px; width: 320px;' : ''}
style={_picError ? 'height: 240px; width: 320px;' : ''}
on:error={() => {
on:error={picErrorHandler}
cover = '/favicon.ico';
_picError = true;
}}
on:click={getInfoPics}
on:click={getInfoPics}
on:keypress={() => {}}
on:keypress={() => {}}
/>
/>
...
...
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