each val, index in [ ... ]
li
a(class=index == 0 ? 'active' : '')
const sourceKey = 'population';
const sourceVal = 2870528;
const targetKey = 'name';const [ val ] = jp.query(cities, `$[?(@.${sourceKey} == ${sourceVal})].${targetKey}`);const val = (cities.find(n => n[sourceKey] === sourceVal) || {})[targetKey];
'use strict';Может кто то знает как решить эту проблему?
<table>
<thead>
<tr>
<th v-for="day in nameOfDays">{{ day }}</th>
</tr>
</thead>
<tbody>
<tr v-for="week in getCalendar">
<td v-for="day in week" class="day">{{ day }}</td>
</tr>
</tbody>
</table>.day:hover {
background: red;
color: white;
}как числа которые относятся к прошлому и будущему месяцу сделать серыми а не черными в отличии чисел нынешнего месяца?
<tr v-for="(week, i) in getCalendar">
<td v-for="day in week" :class="classes(i, day)">{{ day }}</td>
</tr>methods: {
classes(week, day) {
return [
'day',
((!week && day > 7) || (week > 2 && day < 7)) && 'other-month',
];
},
....other-month {
...
function createTree($data, $idField, $parentField, $rootParent) {
foreach ($data as $n) {
$tree[$n[$idField]] = $n;
}
foreach ($data as $n) {
$tree[$n[$parentField]]['children'][] = &$tree[$n[$idField]];
}
return $tree[$rootParent]['children'];
}
$tree = createTree($arr, 'category_id', 'parent_id', '');
:disabled="currentPage === 0"if(this.currentPage % 11 == 0){if(this.currentPage+1 % 11 == 0){this.currentPage == 11;this.currentPage == 0;подскажите пожалуйста что я неправильно делаю
document.addEventListener('change', function(e) {
if (e.target.type === 'radio') {
e.target.closest('form').querySelector('.output').textContent = e.target.value;
}
});
const duplicates = Array
.from(arr.reduce((acc, n) => acc.set(n.id, acc.has(n.id)), new Map))
.reduce((acc, n) => (n[1] && acc.push(n[0]), acc), []);
// или
const duplicates = arr.reduce((acc, { id }) => (
(acc[1][id] = -~acc[1][id]) === 2 && acc[0].push(id),
acc
), [ [], {} ])[0];
// или
const duplicates = [...arr
.reduce((acc, n) => (acc[+acc[0].has(n.id)].add(n.id), acc), [ new Set, new Set ])
.pop()
];
// или
const duplicates = arr
.map(n => n.id)
.filter((n, i, a) => i !== a.indexOf(n))
.filter((n, i, a) => i === a.indexOf(n));
// или
const duplicates = arr.reduce((acc, { id: n }, i, a) => (
!acc.includes(n) && i !== a.findIndex(m => m.id === n) && acc.push(n),
acc
), []);
.active
background-color: #77b97e
color: #fff
&:hover
background-color: #99db8fdocument.addEventListener('click', ({ target: { classList: cl } }) =>
cl.contains('calendar__mounth-day') && cl.toggle('active')
);id у чекбоксов и for у label'ов такими, чтобы клик по label'у переключал состояние чекбокса. Т.е., одинаковыми для пары из чекбокса и соответствующего ему label'а, уникальными для каждой из пар..calendar__mounth-list input:checked + label
background-color: #77b97e
color: #fff
&:hover
background-color: #99db8f
<ui-icon
iconSet="ico-moon"
data-icon="i-more"
@click="stage.show = !stage.show"
><div
class="opportunity-board__list"
v-show="stage.show"
>
s-switch(@switch="switch")this.switch.