Skip to content

Commit 64e18e7

Browse files
author
yuchenyao
committed
定义video pageSize
1 parent 9294610 commit 64e18e7

File tree

1 file changed

+6
-5
lines changed
  • web/src/js/view/newhome/module/workspace

1 file changed

+6
-5
lines changed

web/src/js/view/newhome/module/workspace/index.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ export default {
157157
],
158158
total: null,
159159
pageSize: 4,
160+
videoSize: 4,
160161
pageNum: 1,
161162
videosClick: 1,
162163
videosMaxClick: null,
@@ -271,17 +272,17 @@ export default {
271272
changeVideos() {
272273
this.videosClick += 1;
273274
this.videosClick = this.videosClick > this.videosMaxClick ? 1 : this.videosClick;
274-
const start = ( this.videosClick - 1 ) * this.pageSize;
275-
const end = this.videosClick * this.pageSize;
275+
const start = ( this.videosClick - 1 ) * this.videoSize;
276+
const end = this.videosClick * this.videoSize;
276277
this.videos = this.videoCache.slice(start, end);
277278
},
278279
initVideos() {
279280
const videosTotal = this.videoCache.length;
280-
this.videosMaxClick = Math.ceil(videosTotal / this.pageSize);
281-
if (videosTotal < this.pageSize) {
281+
this.videosMaxClick = Math.ceil(videosTotal / this.videoSize);
282+
if (videosTotal < this.videoSize) {
282283
this.videos = this.videoCache;
283284
} else {
284-
this.videos = this.videoCache.slice(0, this.pageSize);
285+
this.videos = this.videoCache.slice(0, this.videoSize);
285286
}
286287
},
287288
play(item) {

0 commit comments

Comments
 (0)