Jelajahi Sumber

新闻列表

panhui 2 tahun lalu
induk
melakukan
a75f1bfec5
1 mengubah file dengan 2 tambahan dan 8 penghapusan
  1. 2 8
      src/plugins/list.js

+ 2 - 8
src/plugins/list.js

@@ -37,10 +37,7 @@ function useList(url, beforeData = null, httpType) {
             return global.$http
                 .get(url, data, { body: 'json' })
                 .then(res => {
-                    if (res.first) {
-                        list.value = []
-                    }
-                    list.value = [...list.value, ...res.content]
+                    list.value = res.content
                     empty.value = res.empty
                     finished.value = res.last
                     // if (!finished.value) {
@@ -56,10 +53,7 @@ function useList(url, beforeData = null, httpType) {
             return global.$http
                 .post(url, data, { body: 'json' })
                 .then(res => {
-                    if (res.first) {
-                        list.value = []
-                    }
-                    list.value = [...list.value, ...res.content]
+                    list.value = res.content
                     empty.value = res.empty
                     finished.value = res.last
                     // if (!finished.value) {