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
048e28da
Commit
048e28da
authored
Oct 20, 2023
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix search loop
parent
6031cd45
Pipeline
#23797
failed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
src/Content.svelte
src/Content.svelte
+9
-3
src/components/card.svelte
src/components/card.svelte
+4
-4
No files found.
src/Content.svelte
View file @
048e28da
...
...
@@ -53,7 +53,7 @@
.catch(error => {
// 处理错误
console.error('网络请求错误:', error);
我处理一下就行;
//
我处理一下就行;
toast.push('网络请求错误');
});
}
...
...
@@ -74,7 +74,7 @@
List = [...List, ...data];
}
function search(args) {
function search
Tag
(args) {
let searchInfo = {
url: `${$_env}/query.php?action=get&${args}`,
params: {
...
...
@@ -85,12 +85,18 @@
}
}
};
List = [];
createFetch(searchInfo, data => {
console.log(data);
showList(data);
});
}
function onSearch(e) {
console.log('triggered search');
console.log(e.detail.text);
}
</script>
<!-- ----------------------------------------------- DOM ----------------------------------------------- -->
...
...
@@ -103,7 +109,7 @@
cover={$_env + '/' + item.folder.substring(2) + '/rpg_info/1.jpg' ?? ''}
language={categoryList[item.category] || "未知"}
raw_tags={item.tags}
on:search={
search(`tags=${(ev)=>{search(ev.detail.tag)}}`)
}
on:search={
onSearch
}
/>
{/each}
<Card raw_tags="|示例1|示例2|" />
...
...
src/components/card.svelte
View file @
048e28da
...
...
@@ -13,9 +13,10 @@
let error = false;
const raiseEvent = createEventDispatcher();
function searchByTag(tag) {
function searchByTag(e) {
console.log(e);
raiseEvent('search', {
t
ag: tag
t
ext: e.target
});
}
</script>
...
...
@@ -56,8 +57,7 @@
{#each tags as tag}
<div
class="badge badge-outline"
on:click={searchByTag(tag)}
on:keypress={searchByTag(tag)}>{tag}</div>
on:mousedown={searchByTag}>{tag}</div>
{/each}
{/if}
</div>
...
...
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