mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 15:36:49 +08:00
refactor: Update FilterRuleGroupCard.vue to clear selected media category when media type changes
This commit is contained in:
@@ -57,6 +57,7 @@ const mediaTypeItems = [
|
|||||||
|
|
||||||
// 根据选中的媒体类型,获取对应的媒体类别
|
// 根据选中的媒体类型,获取对应的媒体类别
|
||||||
const getCategories = computed(() => {
|
const getCategories = computed(() => {
|
||||||
|
groupInfo.value.category = ''
|
||||||
const default_value = [{ title: '全部', value: '' }]
|
const default_value = [{ title: '全部', value: '' }]
|
||||||
if (!props.categories || !groupInfo.value.media_type || !props.categories[groupInfo.value.media_type ?? ''])
|
if (!props.categories || !groupInfo.value.media_type || !props.categories[groupInfo.value.media_type ?? ''])
|
||||||
return default_value
|
return default_value
|
||||||
@@ -180,15 +181,6 @@ function savegroupInfo() {
|
|||||||
emit('change', groupInfo.value)
|
emit('change', groupInfo.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 监听适用媒体类型数据变化
|
|
||||||
watch(
|
|
||||||
() => groupInfo.value.media_type,
|
|
||||||
() => {
|
|
||||||
// 适用媒体类型变化时,清空适用媒体类别
|
|
||||||
groupInfo.value.category = ''
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
// 按钮点击
|
// 按钮点击
|
||||||
function onClose() {
|
function onClose() {
|
||||||
emit('close')
|
emit('close')
|
||||||
|
|||||||
Reference in New Issue
Block a user