Skip to content

Conversation

@KurskiySergey
Copy link
Owner

No description provided.

Comment on lines +24 to +46
getRequest(jsonFile) {

return new Promise((resolve, reject) => {

var xhr = new XMLHttpRequest();
xhr.open('GET', `${API}${jsonFile}`, true);

xhr.onreadystatechange = () => {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
let response = JSON.parse(xhr.responseText);
resolve(response);
} else {
reject('Error');
}
}
}

xhr.send();

});

},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

у нас же был прекрасный метод с fetch, зачем усложнять?

Comment on lines +78 to +79
this.basket.push(0);
this.basket.pop();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

костыль-костыльный =( Если и идти такой дорогой то тут больше Vue.set поможет но в целом реализация у нас итак уже есть + повторил про нее на уроке.

console.log(data);
for (let item of data) {
console.log(typeof(item));
item['class'] = 'visible';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это можно вынести в шаблон, ибо хранить данные о стилях в списке товаров, которые вообще не должны содержать данные о представлении.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants