File tree Expand file tree Collapse file tree 1 file changed +25
-17
lines changed Expand file tree Collapse file tree 1 file changed +25
-17
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ export default {
58
58
},
59
59
path: {
60
60
type: String ,
61
- required : true ,
61
+ default : null ,
62
62
},
63
63
meta: {
64
64
type: Object ,
@@ -72,34 +72,42 @@ export default {
72
72
methods: {
73
73
firstPage () {
74
74
this .$store .dispatch (this .action , this .links .first ).then (() => {
75
- this .$router .push ({
76
- path: this .path ,
77
- query: { page: 1 },
78
- });
75
+ if (this .path ) {
76
+ this .$router .push ({
77
+ path: this .path ,
78
+ query: { page: 1 },
79
+ });
80
+ }
79
81
});
80
82
},
81
83
prevPage () {
82
84
this .$store .dispatch (this .action , this .links .prev ).then (() => {
83
- this .$router .push ({
84
- path: this .path ,
85
- query: { page: this .meta .current_page - 1 },
86
- });
85
+ if (this .path ) {
86
+ this .$router .push ({
87
+ path: this .path ,
88
+ query: { page: this .meta .current_page - 1 },
89
+ });
90
+ }
87
91
});
88
92
},
89
93
nextPage () {
90
94
this .$store .dispatch (this .action , this .links .next ).then (() => {
91
- this .$router .push ({
92
- path: this .path ,
93
- query: { page: this .meta .current_page + 1 },
94
- });
95
+ if (this .path ) {
96
+ this .$router .push ({
97
+ path: this .path ,
98
+ query: { page: this .meta .current_page + 1 },
99
+ });
100
+ }
95
101
});
96
102
},
97
103
lastPage () {
98
104
this .$store .dispatch (this .action , this .links .last ).then (() => {
99
- this .$router .push ({
100
- path: this .path ,
101
- query: { page: this .meta .last_page },
102
- });
105
+ if (this .path ) {
106
+ this .$router .push ({
107
+ path: this .path ,
108
+ query: { page: this .meta .last_page },
109
+ });
110
+ }
103
111
});
104
112
},
105
113
},
You can’t perform that action at this time.
0 commit comments