File tree 4 files changed +34
-7
lines changed 4 files changed +34
-7
lines changed Original file line number Diff line number Diff line change 11
11
</a >
12
12
<a href =" https://www.npmjs.com/package/vue-pagination-tw " >
13
13
<img src =" https://img.shields.io/npm/dw/vue-pagination-tw " alt =" Downloads " />
14
- </a >
14
+ </a >
15
15
16
16
[ ![ NPM] ( https://nodei.co/npm/vue-pagination-tw.png )] ( https://nodei.co/npm/vue-pagination-tw/ )
17
17
@@ -110,6 +110,21 @@ So this is also avaliable
110
110
/>
111
111
```
112
112
113
+ If you want to specify custom ` Active Border color & text color ` , you can do it like this:
114
+
115
+ ``` html
116
+ <VuePaginationTw
117
+ :totalItems =" 20"
118
+ :currentPage =" 1"
119
+ :perPage =" 6"
120
+ @pageChanged =" functionName"
121
+ :goButton =" false"
122
+ styled =" centered"
123
+ borderActiveColor =" border-red-500"
124
+ borderTextActiveColor =" text-red-500"
125
+ />
126
+ ```
127
+
113
128
#### roadmaps
114
129
115
130
- [ ] Make different versions of paginations (xs, md, lg, xlg)
Original file line number Diff line number Diff line change @@ -16,9 +16,9 @@ export default defineComponent({
16
16
}
17
17
},
18
18
mounted() {
19
- // let externalScript = document.createElement('script')
20
- // externalScript.setAttribute('src', 'https://cdn.tailwindcss.com')
21
- // document.head.appendChild(externalScript)
19
+ let externalScript = document .createElement (' script' )
20
+ externalScript .setAttribute (' src' , ' https://cdn.tailwindcss.com' )
21
+ document .head .appendChild (externalScript )
22
22
}
23
23
});
24
24
</script >
@@ -33,6 +33,8 @@ export default defineComponent({
33
33
:per-page =" 6"
34
34
@page-changed =" console.log('s')"
35
35
:go-button =" false"
36
+ borderActiveColor =" border-red-500"
37
+ borderTextActiveColor =" text-red-500"
36
38
/>
37
39
</div >
38
40
</div >
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-pagination-tw" ,
3
- "version" : " 0.1.1 " ,
3
+ "version" : " 0.1.2 " ,
4
4
"description" : " Simple Vue Pagination component that can be used in any project with range & ui customization." ,
5
5
"main" : " dist/vue-pagination-tw.ssr.js" ,
6
6
"browser" : " dist/vue-pagination-tw.esm.js" ,
Original file line number Diff line number Diff line change @@ -30,6 +30,14 @@ const props = defineProps({
30
30
type: String ,
31
31
default: ' Go'
32
32
},
33
+ borderActiveColor: {
34
+ type: String ,
35
+ default: ' border-indigo-500'
36
+ },
37
+ borderTextActiveColor: {
38
+ type: String ,
39
+ default: ' text-indigo-500'
40
+ },
33
41
styled: {
34
42
type: String ,
35
43
default: ' simple'
@@ -141,9 +149,10 @@ const calculatedPages = computed(() => {
141
149
v-for =" (page, index) in calculatedPages"
142
150
:key =" index"
143
151
class =" bg-white border border-gray-300 text-gray-500 relative inline-flex items-center px-4 py-2 text-sm font-medium"
144
- :class =" { ' z-10 bg-indigo-50 border-indigo-500 text-indigo-600' : currentPage == page }"
152
+ :class =" { [` z-10 bg-indigo-50 !${borderActiveColor} !${borderTextActiveColor}`] : currentPage == page }"
145
153
@click.prevent =" changePage(page)"
146
154
>{{ page }}</a >
155
+ <!-- :class="currentPage === page ? `z-10 bg-indigo-50 !${borderActiveColor} !${borderTextActiveColor}` : '' }" -->
147
156
<span
148
157
class =" relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700"
149
158
v-if =" hasLast()"
@@ -197,7 +206,8 @@ const calculatedPages = computed(() => {
197
206
<input
198
207
type =" text"
199
208
placeholder =" Page no"
200
- class =" w-28 px-4 py-1 rounded-l outline-none border-t-2 border-l-2 border-b-2 focus:border-indigo-500 placeholder:text-xs uppercase font-semibold"
209
+ class =" w-28 px-4 py-1 rounded-l outline-none border-t-2 border-l-2 border-b-2 placeholder:text-xs uppercase font-semibold"
210
+ :class =" `focus:${borderActiveColor}`"
201
211
v-model =" pageInput"
202
212
/>
203
213
<button
You can’t perform that action at this time.
0 commit comments