function getDatesIntervalStr(dates) {
const dateParts = d => ({ year: d.year(), month: d.format('MMMM') });
const start = dateParts(dates[0]);
const end = dateParts(dates[dates.length - 1]);
if (start.year !== end.year) {
return `${start.month} ${start.year} - ${end.month} ${end.year}`;
} else if (start.month !== end.month) {
return `${start.month} - ${end.month} ${end.year}`;
} else {
return `${end.month} - ${end.year}`;
}
}
data: () => ({
selected: [],
}),
methods: {
key: (x, y) => `${y}.${x}`,
select({ buttons, target: { dataset: { key } } }) {
if (buttons) {
const index = this.selected.indexOf(key);
if (index !== -1) {
this.selected.splice(index, 1);
} else {
this.selected.push(key);
}
}
},
},<table>
<tr v-for="y in 10">
<td
v-for="x in 10"
@mousedown="select"
@mouseover="select"
:data-key="key(x, y)"
:class="{ selected: selected.includes(key(x, y)) }"
>{{ key(x, y) }}</td>
</tr>
</table>data: () => ({
items: [...Array(10)].map(() => Array(10).fill(false)),
}),
methods: {
select(row, index, e) {
if (e.buttons) {
this.$set(row, index, !row[index]);
}
},
},<table>
<tr v-for="(row, y) in items">
<td
v-for="(cell, x) in row"
@mousedown="select(row, x, $event)"
@mouseover="select(row, x, $event)"
:class="{ selected: cell }"
>{{ y + 1 }}.{{ x + 1 }}</td>
</tr>
</table>
transition-group, у отдельных элементов списка анимируем высоту (должна быть задана).
Тут сама сложность в том чтоб сделать бордер.
chart: {
events: {
click() {
this.update({
yAxis: {
breaks: новое значение для breaks,
},
});
},
},
},
<div class="colors">
<div class="color" data-color="blue">Blue</div>
<div class="color" data-color="red">Red</div>
<div class="color" data-color="pink">Pink</div>
</div>let selectedTD = null;
const $colors = $('.colors').on('click', '.color', function() {
$(selectedTD).css('backgroundColor', this.dataset.color);
selectedTD = null;
$colors.hide();
}).hide();
$('table').on('click', 'td', function() {
selectedTD = selectedTD === this ? null : this;
$colors.toggle(!!selectedTD);
});
...или есть какой-то скрытый от меня смысл?
It will handle cases withSymbol.toPrimitivecorrectly and throw correctly if template literal expression is aSymbol(). See babel/babel#5791.
Vue.use(window['v-show-slide'].default);.
.images_box-model-spec {
order: 1;
}
.itemsnew-list-item-wrapper {
order: 2;
}
allTasks: {
get() {
return this.$store.state.tasks;
},
set(val) {
this.$store.commit('allTasks', val);
},
},draggable.tasks__wrap(v-model="allTasks")
...
computed: {
all: {
get() {
return this.filters.every(n => n.active);
},
set(val) {
this.filters.forEach(n => n.active = val);
},
},
},<label>
<input type="checkbox" v-model="all">
ALL
</label>