优化 MediaCard 和 SearchSiteDialog 组件,移除全选功能并调整已选择站点的逻辑

This commit is contained in:
jxxghp
2025-04-04 09:39:04 +08:00
parent c5e62cc8e4
commit 7ae3e402cf
2 changed files with 7 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import type { Site, Plugin, Subscribe } from '@/api/types'
import { PropType } from 'vue'
import { popScopeId, PropType } from 'vue'
const props = defineProps({
sites: {
@@ -23,6 +23,12 @@ const siteFilter = ref('')
// 已选择站点
const selectedSites = ref<any[]>(props.selected || [])
watchEffect(() => {
if (!selectedSites.value && props.selected){
selectedSites.value = props.selected
}
})
// 全选/全不选按钮文字
const checkAllText = computed(() => {
return selectedSites.value.length < props.sites?.length ? '选择全部' : '取消全选'