выводит побуквенно
v-for так и перебирает - "побуквенно". То есть, значениями user являются строки единичной длины. Ну а свойств id, name, price и т.д. у строк нет, отсюда пустота там, где вы выводите свойства элементов users.
почему не удаляется item, а добавляется?
slice(0, -1)) плюс полная копия (slice(0)).deleteItem = id => {
this.setState(({ todoData }) => ({
todoData: todoData.filter(n => n.id !== id),
}));
}
const newArr = [];
for (const n of arr) {
const [ us, s ] = n.us.split('-').map(n => n.split('_').map(Number));
newArr.push({
...n,
us: arr1.filter(n => us.includes(n)),
s,
});
}const newArr = arr.map(function(n) {
const us = n.us.match(/\d+/g).map(n => +n);
const s = us.splice(-1);
return {
id: n.id,
us: this(us),
s,
};
}, us => arr1.filter(Set.prototype.has.bind(new Set(us))));
const getFreeDomainsCount = arr => arr
.map(n => n.split('@')[1])
.filter(n => freeEmailDomains.includes(n))
.reduce((acc, n) => (++acc[n], acc), Object.fromEntries(freeEmailDomains.map(n => [ n, 0 ])));
const obj = arr.find(n => n.id === newObj.id);
if (obj) {
Object.assign(obj, newObj);
} else {
arr.push(newObj);
}
PHPSESSID=(.*?);
.hidden {
transform: scale(0);
}.item {
transition: transform 0.5s;
}document.querySelectorAll('.item').forEach(n => n.classList.remove('hidden'));
mounted() {
this.cropper = new Cropper(this.$refs.image, {
zoomable: false,
scalable: false,
aspectRatio: 1,
});
},
methods: {
selectFile(e) {
const file = (e.target.files || e.dataTransfer.files)[0];
if (file) {
const reader = new FileReader();
reader.onload = e => this.cropper.replace(e.target.result);
reader.readAsDataURL(file);
}
},
},
let
map = null,
marker = null;
document.addEventListener('click', function(e) {
if (!e.target.classList.contains('contacts__address--link')) {
return;
}
e.preventDefault();
const
addressData = e.target.closest('.js-address').dataset,
coord = [ addressData.longtitude, addressData.latitude ];
if (!map) {
map = new ymaps.Map('map', {
center: coord,
zoom: 17,
});
marker = new ymaps.Placemark(coord);
map.geoObjects.add(marker);
map.behaviors.disable('scrollZoom');
} else {
map.setCenter(coord);
marker.geometry.setCoordinates(coord);
}
});
const groupedArr2 = arr2.reduce((acc, n) => {
(acc[n.parent_id] = acc[n.parent_id] || []).push(n);
return acc;
}, {});arr1.forEach(n => n.arr2 = groupedArr2[n.id] || []);const newArr1 = arr1.map(n => ({ ...n, arr2: groupedArr2[n.id] || [] }));
$('.modification').on('change', function() {
const sum = $('[type="radio"]:checked', this)
.siblings('.radio__text')
.get()
.reduce((acc, n) => acc + +$(n).text(), 0);
$('p span').text(sum);
}).trigger('change');const container = document.querySelector('.modification');
container.addEventListener('change', e => {
const sum = Array.prototype.reduce.call(
e.currentTarget.querySelectorAll('[type="radio"]:checked'),
(acc, n) => acc + +n.closest('.radio').querySelector('.radio__text').innerText,
0
);
document.querySelector('p span').innerText = sum;
});
container.dispatchEvent(new Event('change'));
methods: {
onPopupOpen(e) {
e.target
.getPopup()
.getElement()
.querySelector('.leaflet-popup-content-wrapper')
.addEventListener('dblclick', this.onPopupDblClick);
},
onPopupDblClick(e) {
const
id = +e.currentTarget.querySelector('[data-id]').dataset.id,
// теперь, зная id, можно найти соответствующий объект
....once('popupopen', this.onPopupOpen)
event.target. Надо только (так как обработчик делегированный) убедиться, что событие случилось действительно на одном из интересующих вас элементов (раз это textarea, то, например, путём проверки свойства tagName у целевого элемента).