Skip to content

Commit

Permalink
fix: 发现页唯一子分类时没加载 (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
aooiuu committed May 14, 2024
1 parent 279eac3 commit 0c6c78e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions packages/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"displayName": "any-reader",
"description": "自定义规则多站点聚合搜索阅读小说、漫画。包含JS规则解析库和VSCode插件。支持本地小说 TXT、EPUB",
"icon": "resources/icon.png",
"version": "0.7.2",
"preview": true,
"version": "0.8.0",
"publisher": "aooiu",
"qna": "https://github.com/aooiuu/any-reader/issues",
"bugs": {
Expand Down
5 changes: 5 additions & 0 deletions packages/web/src/pages/discover/Category.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@ const value = ref<string>('');
const nextList = ref([]);
function onInput(v: any) {
if (!v) return;
value.value = v;
const row = props.list.find((e) => e.name === value.value);
nextList.value = row.pairs || [];
if (nextList.value.length === 0) {
// 没有子项目时, 加载本身
emit('change', row);
} else if (nextList.value.length === 1) {
// 只有一个子项目的时候加载子项目
emit('change', nextList.value[0]);
}
}
Expand Down

0 comments on commit 0c6c78e

Please sign in to comment.