<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 = Object
.entries(arr.reduce((acc, n) => (acc[n.id] = (acc[n.id] || 0) + 1, acc), {}))
.filter(n => n[1] > 1)
.map(n => +n[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
), []);
<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
. row.toggleDetails
в качестве обработчика клика, можно завернуть его в метод, который будет принимать row
и проверять наличие дополнительной информации, инициируя её подгрузку в случае отсутствия. Например (вместо запроса setTimeout, но думаю, что суть ясна). model: {
prop: 'checked',
},
props: {
value: [ String, Number ],
checked: [ Boolean, Array ],
label: String,
disabled: Boolean,
},
computed: {
model: {
get() {
return this.checked;
},
set(val) {
this.$emit('input', val);
},
},
},
<label>
<input
type="checkbox"
v-model="model"
:value="value"
:disabled="disabled"
/>
{{ label }}
</label>
animated: false
на animated: Array(6).fill(false)
.<div
v-for="n in animated"
:class="{ animated: n }"
...
this.$refs.animate.forEach((n, i) => new Waypoint.Inview({
element: n,
entered: () => this.$set(this.animated, i, true),
exited: () => this.$set(this.animated, i, false),
}));
$('.slider').slider('values', [ thisfrom, thisto ]);