function calcTable(size) {
const result = [];
for (let i = 1; i <= size; i++) {
for (let j = 1; j <= size; j++) {
result.push(i * j);
}
console.log(result);
result.length = 0;
}
}
calcTable(15);
<li>
по дата-атрибуту и добавляйте в его ol. notes всё что душе угодно."use strict"
let requestCount = 0;
window.addEventListener('scroll', async () => {
const result = await getComment();
console.log(result);
});
function getComment() {
return new Promise(((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.open('GET', `${document.URL}comments/${requestCount}/`);
xhr.onload = function () {
if (xhr.status === XMLHttpRequest.DONE) {
set_comment(...);
requestCount++;
resolve(xhr.response);
} else {
reject(xhr.status);
}
};
xhr.send();
}));
}
npm install --save-dev @babel/core @babel/node @babel/preset-env
<template>
<component :is="dynamicComponent"
:someProps="ololoProps"
/>
</template>
<script>
export default {
name: 'OloloComponent',
data() {
return {
ololoData: 'someShit',
};
},
computed: {
dynamicComponent() {
if (someCondition) {
return () => import('pages/card.vue');
} else if (someAnotherCondition) {
return () => import('pages/post.vue'');
}
return () => import('pages/tag.vue'');
},
ololoProps() {
return { ololo1: 'testData', ololo2: 'test2' };
},
},
}
</script>