X-Git-Url: https://git.auder.net/assets/current/git-favicon.png?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FMoveList.vue;h=30ed2338f01c520e37b8269f24a46cd3b25c2d0b;hb=df647c70b4148894c7d87fc499df5a9050347aec;hp=73c10f0fbf771c87084fa030e009effa547aab71;hpb=144c900354f828ff2321a94db364bf436bff4586;p=vchess.git diff --git a/client/src/components/MoveList.vue b/client/src/components/MoveList.vue index 73c10f0f..30ed2338 100644 --- a/client/src/components/MoveList.vue +++ b/client/src/components/MoveList.vue @@ -1,3 +1,130 @@ + + + + + error + newValue = 0; //avoid rows[-1] => error // $nextTick to wait for table > tr to be rendered this.$nextTick( () => { let rows = document.querySelectorAll('#movesList tr'); @@ -44,24 +170,8 @@ export default { }, }, computed: { - groupedMoves: function() { - let groups = []; - let curCol = undefined; - for (let idx=0; idx < this.moves.length; idx++) - { - const m = this.moves[idx]; - if (m.color == curCol) - { - const gidx = groups.length - 1; - groups[gidx].moves.push(m); - } - else - { - curCol = m.color; - groups.push({moves: [m], idx: groups.length}); - } - } - return groups; + evenNumbers: function() { + return [...Array(this.moves.length).keys()].filter(i => i%2==0); }, }, methods: { @@ -71,18 +181,4 @@ export default { }, }; - - +-->