File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed
Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -276,7 +276,7 @@ const handleFocusNextCheckbox = (event: KeyboardEvent) => {
276276
277277 if (currentIndex !== - 1 ) {
278278 const nextIndex = (currentIndex + 1 ) % checkboxes .length
279- checkboxes [nextIndex ].focus ()
279+ checkboxes [nextIndex ]? .focus ()
280280 }
281281}
282282
@@ -289,7 +289,7 @@ const handleFocusPreviousCheckbox = (event: KeyboardEvent) => {
289289 if (currentIndex !== - 1 ) {
290290 const previousIndex =
291291 (currentIndex - 1 + checkboxes .length ) % checkboxes .length
292- checkboxes [previousIndex ].focus ()
292+ checkboxes [previousIndex ]? .focus ()
293293 }
294294}
295295
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ const endIndex = computed(() => {
2929const displayedPages = computed (() => {
3030 return props .pages .length > props .truncLimit ? props .pages .slice (startIndex .value , endIndex .value + 1 ) : props .pages
3131})
32- const lastPage = props .pages [props .pages .length - 1 ]
32+ const lastPage = computed (() => props .pages [props .pages .length - 1 ])
3333
3434const updatePage = (index : number ) => emit (' update:current-page' , index )
3535const toPage = (index : number ) => updatePage (index )
@@ -89,14 +89,14 @@ const isCurrentPage = (page: Page) => props.pages.indexOf(page) === props.curren
8989 <li v-if =" endIndex < pages.length - 2" >
9090 <span class =" fr-pagination__link fr-unhidden-lg" >...</span >
9191 </li >
92- <li v-if =" endIndex < pages.length - 1" >
92+ <li v-if =" endIndex < pages.length - 1 && lastPage " >
9393 <a
94- :href =" lastPage.href"
94+ :href =" lastPage? .href"
9595 class =" fr-pagination__link fr-unhidden-lg"
96- :title =" (lastPage.title !== lastPage.label) ? lastPage.title : undefined"
97- :aria-current =" isCurrentPage(lastPage) ? 'page' : undefined"
98- @click.prevent =" toPage(props.pages.indexOf(lastPage))"
99- >{{ lastPage.label }}</a >
96+ :title =" lastPage && (lastPage.title !== lastPage.label) ? lastPage.title : undefined"
97+ :aria-current =" lastPage && isCurrentPage(lastPage) ? 'page' : undefined"
98+ @click.prevent =" lastPage && toPage(props.pages.indexOf(lastPage))"
99+ >{{ lastPage? .label }}</a >
100100 </li >
101101 <li >
102102 <a
Original file line number Diff line number Diff line change @@ -95,8 +95,8 @@ const goLastPage = () => {
9595 :key ="
9696 rowKey && getRowData(row as string[][])
9797 ? typeof rowKey === 'string'
98- ? getRowData(row as string[][])! [headers.indexOf(rowKey)].toString()
99- : rowKey(getRowData(row as string[][]))
98+ ? getRowData(row as string[][])?. [headers.indexOf(rowKey)]? .toString()
99+ : rowKey(getRowData(row as string[][]) ?? [] )
100100 : i
101101 "
102102 :row-data =" getRowData(row as string[][])"
You can’t perform that action at this time.
0 commit comments