guhongwei %!s(int64=5) %!d(string=hai) anos
pai
achega
59f65ef07d
Modificáronse 3 ficheiros con 13 adicións e 9 borrados
  1. 2 2
      public/static/css/style.css
  2. 2 2
      src/style/style.css
  3. 9 5
      src/views/news-list/index.vue

+ 2 - 2
public/static/css/style.css

@@ -1835,7 +1835,7 @@ th {
 
 /* 无图片列表开始 */
 .newlistmain {
-	height: 830px;
+	height: 600px;
 	margin: 10px 0 20px 0;
 	box-shadow: 0 0 10px #2d64b3;
 	border-radius: 10px;
@@ -1864,7 +1864,7 @@ th {
 
 .newlistmain .newlistcontext {
 	font-size: 16px;
-	height: 680px;
+	/* height: 680px; */
 	padding: 0 40px 0 40px;
 }
 

+ 2 - 2
src/style/style.css

@@ -1681,7 +1681,7 @@ p {
 
 /* 无图片列表开始 */
 .newlistmain {
-	height: 830px;
+	height: 600px;
 	margin: 10px 0 20px 0;
 	box-shadow: 0 0 10px #2d64b3;
 	border-radius: 10px;
@@ -1710,7 +1710,7 @@ p {
 
 .newlistmain .newlistcontext {
 	font-size: 16px;
-	height: 680px;
+	/* height: 680px; */
 	padding: 0 40px 0 40px;
 }
 

+ 9 - 5
src/views/news-list/index.vue

@@ -21,7 +21,10 @@
             <el-pagination
               @size-change="handleSizeChange"
               @current-change="handleCurrentChange"
-              :current-page="currentPage"
+              :current-page.sync="currentPage"
+              :page-sizes="[10, 20, 30, 40]"
+              :page-size.sync="limit"
+              background
               layout="total, prev, pager, next, jumper"
               :total="total"
             >
@@ -44,8 +47,9 @@ export default {
   data: () => {
     return {
       list: [],
-      total: 0,
       currentPage: 1,
+      limit: 10,
+      total: 0,
     };
   },
   created() {
@@ -69,14 +73,14 @@ export default {
     },
     click(id) {
       this.$router.push({ path: '/live/detail', query: { id: id } });
-      console.log(id);
     },
 
     handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
+      this.$set(this, `currentPage`, 1);
+      this.searchList({ skip: 0, limit: val });
     },
     handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
+      this.searchList({ skip: (val - 1) * this.limit, limit: this.limit });
     },
   },
   computed: {