Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #96 当选项超过100时 弹出确认框确认是否全选防止误触 #104

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/views/Achievement/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
<div class="chk">
<el-checkbox v-model="hideFinished" label="隐藏已完成" size="large" />
</div>
<div class="chk">
<div v-if="!checkIfAllCat" class="chk">
<el-checkbox
v-model="selectAllCat"
label="全选本页"
Expand Down Expand Up @@ -438,8 +438,9 @@ export default defineComponent({
}, 0)
})
const route = useRoute()
const ALLCAT = 'wonders-of-the-world'
const currentCatId = computed(() => {
return route.params.cat || 'wonders_of_the_world'
return route.params.cat || ALLCAT
})
const currentCat = computed(() => {
const v = achievementCat.value.find((i) => i.key === currentCatId.value) || achievementCat.value[0]
Expand Down Expand Up @@ -608,6 +609,7 @@ export default defineComponent({
}
return data
})
const checkIfAllCat = computed(() => currentCatId.value === ALLCAT)
const checkAllCat = (checked: boolean) => {
const data = currentCat.value.achievements.concat([])
if (checked) {
Expand Down Expand Up @@ -761,6 +763,7 @@ export default defineComponent({
sortByStatus,
hideFinished,
selectAllCat,
checkIfAllCat,
checkAllCat,
totalCount,
totalFin,
Expand Down