mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-04 23:18:44 +08:00
feat:优化TheMovieDbView组件的watch逻辑,分离类型和过滤参数的监听,确保列表刷新更高效
This commit is contained in:
@@ -99,11 +99,18 @@ const tmdbLanguageDict = {
|
|||||||
// 当前Key
|
// 当前Key
|
||||||
const currentKey = ref(0)
|
const currentKey = ref(0)
|
||||||
|
|
||||||
// 类型和过滤参数变化后重新刷新列表
|
// 类型变化
|
||||||
watch([type, filterParams], () => {
|
watch(type, () => {
|
||||||
if (!type.value) {
|
if (!type.value) {
|
||||||
type.value = 'movies'
|
type.value = 'movies'
|
||||||
}
|
}
|
||||||
|
filterParams.with_genres = ''
|
||||||
|
filterParams.sort_by = 'popularity.desc'
|
||||||
|
currentKey.value++
|
||||||
|
})
|
||||||
|
|
||||||
|
// 过滤参数变化
|
||||||
|
watch(filterParams, () => {
|
||||||
if (!filterParams.sort_by) {
|
if (!filterParams.sort_by) {
|
||||||
filterParams.sort_by = 'popularity.desc'
|
filterParams.sort_by = 'popularity.desc'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user