@@ -89,18 +89,27 @@ const handleNextPage = () => {
8989 }
9090};
9191
92- const handleInputChange = (value : string ) => {
92+ const handleInputChange = (value : string | number | null ) => {
9393 // Only allow numeric input
94- const numericValue = value .replace (/ [^ 0-9 ] / g , ' ' );
94+ const numericValue = String ( value ?? ' ' ) .replace (/ [^ 0-9 ] / g , ' ' );
9595 inputValue .value = numericValue ;
9696};
9797
9898const isPreviousDisabled = computed (() => state .value .currentPage === 1 );
9999const isNextDisabled = computed (() => state .value .currentPage === state .value .totalPages );
100100 </script >
101101<template >
102- <div @mouseenter =" handleMouseEnter" @mouseleave =" handleMouseLeave" class =" page-controls" >
103- <q-card flat bordered class =" page-controls-card row items-center q-gutter-sm" >
102+ <div
103+ @mouseenter =" handleMouseEnter"
104+ @mouseleave =" handleMouseLeave"
105+ class =" page-controls"
106+ :style =" { opacity: isVisible ? 1 : 0 }"
107+ >
108+ <q-card
109+ flat
110+ bordered
111+ class =" row q-gutter-sm bg-grey-1 rounded-borders q-px-sm q-py-xs items-center"
112+ >
104113 <!-- Previous page button -->
105114 <q-btn
106115 flat
@@ -112,7 +121,7 @@ const isNextDisabled = computed(() => state.value.currentPage === state.value.to
112121 />
113122
114123 <!-- Page input form -->
115- <form @submit.prevent =" handlePageSubmit" class =" page-form row items-center q-gutter-xs" >
124+ <form @submit.prevent =" handlePageSubmit" class =" page-form row q-gutter-xs items-center " >
116125 <q-input
117126 dense
118127 outlined
@@ -123,8 +132,8 @@ const isNextDisabled = computed(() => state.value.currentPage === state.value.to
123132 @keyup.enter.prevent =" handlePageSubmit"
124133 hide-bottom-space
125134 />
126- <span class =" page-text" >/</span >
127- <span class =" page-text" >{{ state.totalPages }}</span >
135+ <span class =" page-text text-grey-6 " >/</span >
136+ <span class =" page-text text-grey-6 " >{{ state.totalPages }}</span >
128137 </form >
129138
130139 <!-- Next page button -->
@@ -147,22 +156,14 @@ const isNextDisabled = computed(() => state.value.currentPage === state.value.to
147156 left : 50% ;
148157 transform : translateX (-50% );
149158 z-index : 1000 ;
150- opacity : v-bind(isVisible ? 1 : 0 );
151159 transition : opacity 0.2s ease-in-out ;
152160}
153161
154- .page-controls-card {
155- background-color : #f8f9fa ;
156- padding : 6px 10px ;
157- border-radius : 10px ;
158- }
159-
160162.page-input {
161163 width : 48px ;
162164}
163165
164166.page-text {
165- color : #6c757d ;
166167 font-size : 14px ;
167168}
168169 </style >
0 commit comments