You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,11 @@
6
6
## Support
7
7
> Laravel 5.x and Vue 2.x
8
8
## npm
9
-
```
9
+
```
10
10
npm install vue2-laravel-pagination --save-dev
11
11
```
12
12
## yarn
13
-
```
13
+
```
14
14
yarn add vue2-laravel-pagination --save-dev
15
15
```
16
16
## Then
@@ -21,7 +21,7 @@ import Pagination from 'vue2-laravel-pagination'
21
21
```$xslt
22
22
public function getQuestion() {
23
23
$questions = Question::paginte(5);
24
-
24
+
25
25
return response()->json($questions, 200);
26
26
}
27
27
```
@@ -45,10 +45,26 @@ total: 25
45
45
:current="questions.current_page"
46
46
:total="questions.total"
47
47
:per-page="questions.per_page"
48
+
@page-changed="fetchData"
48
49
>
49
50
</pagination>
50
51
</template>
51
52
```
53
+
> The $emit('page-changed') is triggering when the page paginate numbers or next button clicked, so you must write that method to fetch next page with your data.
0 commit comments