Пробовал указывать v-model="filter['name']" и вешать вотчер на filter, но этот вотчер срабатывает только при изменение ключей массива, но не значений. На изменение значений не реагирует.
deep: true
в настройках watcher'а:watch: {
filters: {
deep: true,
handler(val) {
console.log(JSON.stringify(val, null, 2));
},
},
},
[...document.getElementsByClassName('cls')].reduce((max, n) => {
const val = +n.innerText;
return val > max[1] ? [ n, val ] : max;
}, [ null, -Infinity ])[0].style.color = 'red';
с респонсом все впорядке
<...>
нехочет переиницыализировать плагин
watch: {
массивДанных() {
this.$nextTick(this.$redrawVueMasonry);
},
},
const text = [
'hello, world!!',
'fuck the world',
'fuck everything',
];
$('table').on('click', 'td', function() {
const $this = $(this);
const index = (+$this.data('index') + 1) % text.length;
$this.text(text[index]).data('index', index);
}).find('td').data('index', -1);
SELECT
question_id,
SUM(points < 1) AS 'Incorrect',
SUM(points >= 1) AS 'Correct'
FROM
`cp_question_student`
GROUP BY
question_id
document.body.appendChild(anchor)
. А потом уже делать click. function removeWords($str, $n) {
return implode(' ', array_slice(explode(' ', $str), 0, $n - 1));
}
echo removeWords("Бухгалтерский учет и анализ слонов", 3);
function createTree(data, levelKey, childrenKey) {
const tree = [];
data.forEach(n => {
let arr = tree;
for (let level = 0; n[levelKey] > level++;) {
arr = arr[arr.length - 1][childrenKey];
}
arr.push(Object.assign({ [childrenKey]: [] }, n));
});
return tree;
}
const tree = createTree([
{ id: 1, title: 'test1', level: 0 },
{ id: 2, title: 'test2', level: 1 },
{ id: 3, title: 'test3', level: 2 },
{ id: 4, title: 'test4', level: 1 },
{ id: 5, title: 'test5', level: 0 },
], 'level', 'nodes');
for (int j = i + i;...
, наверное всё-таки должно быть i + 1
.