async function anonymous(__self,scope ) { with (scope) { __self.result = { preload: 4, shouldLoadLazy: true, fetchRandom() { const rand = (min, max) => { min = Math.ceil(min) max = Math.floor(max) return Math.floor(Math.random() * (max - min + 1) + min) } let i; this.$refs.random.innerHTML = document.getElementById('preload_1').innerHTML if (this.shouldLoadLazy) { this.initLozad() } for (i = 1; i <= this.preload - 1; i++) { document.getElementById(`preload_${i}`).innerHTML = document.getElementById(`preload_${i + 1}`).innerHTML } axios.get(`/random/${rand(2, 100)}`) .then(response => { this.$refs['preload-container'].innerHTML = response.data this.shouldLoadLazy = false }) }, } }; __self.finished = true; return __self.result; }