Production

This commit is contained in:
saeid
2019-04-29 20:30:32 +04:30
parent 3cced107bb
commit dfda9768f0
9 changed files with 36 additions and 25 deletions
+7 -10
View File
@@ -139,16 +139,8 @@ export default {
this.load();
},
methods: {
async load() {
const result = await ApiService.get(urls.listTestResult);
if (result && result.status == 200) {
this.items = result.data.data.data;
this.currentPage = result.data.data.current_page;
this.lastPage = result.data.data.last_page;
}
},
async load() {
const result = await ApiService.get(urls.listTestResult);
async load(page = 1) {
const result = await ApiService.get(urls.listTestResult(page));
if (result && result.status == 200) {
this.items = result.data.data.data;
this.currentPage = result.data.data.current_page;
@@ -165,6 +157,11 @@ export default {
}
}
},
},
watch: {
currentPage(page) {
this.load(page);
}
}
}
</script>