str = str[0].toUpperCase() + str.slice(1);
// или
str = str.replace(/^./, m => m.toUpperCase());
// или
str = Array.from(str, (n, i) => i ? n : n.toUpperCase()).join('');
.main-footer__box:has(input:focus) label {
color: red;
}
const names = [ 'DIV', 'P', 'SPAN', ... ];
if (names.includes(el.nextSibling.nodeName)) {
...
-1
- добавить значение в массив, в противном случае - удалить:const active = [];
document.addEventListener('click', ({ target: t }) => {
const value = t.dataset['data-атрибут'];
if (value) {
const index = active.indexOf(value);
if (index === -1) {
active.push(value);
} else {
active.splice(index, 1);
}
}
});
document.addEventListener('click', ({ target: t }) => {
if (t.dataset['data-атрибут']) {
t.classList.toggle('active');
}
});
const active = Array
.from(document.querySelectorAll('.active'), n => n.dataset['data-атрибут'])
.join(', ');
key
с элементов .d_day
и .li_day
. Элементам .d_day
добавить общую обёртку, ей в качестве key
указать currentPage
. Заменить transition-group
на transition
. 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;
подскажите пожалуйста что я неправильно делаю