+ props: ["moves","cursor","score","message"],
+ watch: {
+ cursor: function(newValue) {
+ // $nextTick to wait for table > tr to be rendered
+ this.$nextTick( () => {
+ let rows = document.querySelectorAll('#movesList tr');
+ if (rows.length > 0)
+ {
+ rows[Math.floor(newValue/2)].scrollIntoView({
+ behavior: 'smooth',
+ block: 'center'
+ });
+ }
+ });
+ },
+ },
+ computed: {
+ evenNumbers: function() {
+ return [...Array(this.moves.length).keys()].filter(i => i%2==0);
+ },
+ },
+ methods: {
+ gotoMove: function(index) {
+ this.$emit("goto-move", index);
+ },
+ },
+};
+</script>
+
+<style lang="sass" scoped>
+.moves-list
+ min-width: 250px
+td.highlight-lm
+ background-color: plum
+</style>
+
+<!-- Old render method:
+ render(h) {