fix:修改菜单找不到图标时报错

This commit is contained in:
chiwenda 2023-03-12 17:22:51 +08:00
parent 1757515b14
commit 8c9217166d

View File

@ -45,17 +45,22 @@ const tabsList = [
const pageList = computed(() => {
if (currentPage.value === 1) {
return copyIconList[currentActiveType.value]
.filter((v) => v.includes(filterValue.value))
?.filter((v) => v.includes(filterValue.value))
.slice(currentPage.value - 1, pageSize.value)
} else {
return copyIconList[currentActiveType.value]
.filter((v) => v.includes(filterValue.value))
?.filter((v) => v.includes(filterValue.value))
.slice(
pageSize.value * (currentPage.value - 1),
pageSize.value * (currentPage.value - 1) + pageSize.value
)
}
})
const iconCount = computed(() => {
return copyIconList[currentActiveType.value] == undefined
? 0
: copyIconList[currentActiveType.value].length
})
const iconItemStyle = computed((): ParameterCSSProperties => {
return (item) => {
@ -159,7 +164,7 @@ watch(
<ElPagination
small
:total="copyIconList[currentActiveType].length as unknown as number"
:total="iconCount"
:page-size="pageSize"
:current-page="currentPage"
background