.el {
animation: blink 2s linear infinite;
background: #000;
}
.el:nth-child(1) { animation-delay: 0s; }
.el:nth-child(2) { animation-delay: 0.5s; }
.el:nth-child(3) { animation-delay: 1s; }
.el:nth-child(4) { animation-delay: 1.5s; }
@keyframes blink {
0%, 20% {
background: #000;
}
10% {
background: #F00;
}
}
function App() {
const [ items, setItems ] = useState([]);
const onItemClick = ({ target: { dataset: { id } } }) =>
setItems(items.filter(n => n !== +id));
const onAddNewClick = () =>
setItems([ ...items, 1 + Math.max(0, ...items) ]);
return (
<div>
{items.map(n => <button onClick={onItemClick} data-id={n}>#{n}</button>)}
<button onClick={onAddNewClick}>add</button>
</div>
);
}
data: () => ({
items: [ ... ], // массив данных
columns: 666, // количество колонок, на которые надо разбить items
}),
computed: {
columnItems() {
const { items, columns } = this;
const colSize = Math.ceil(items.length / columns);
return Array.from(
{ length: columns },
(n, i) => items.slice(i * colSize, (i + 1) * colSize)
);
},
},
<ul v-for="col in columnItems">
<li v-for="n in col">{{ n }}</li>
</ul>
<img v-for="i in 5" :src="i > ratingValue ? whiteStar : blackStar">
Array
.from(document.querySelectorAll('.obj'))
.filter(n => n.querySelector('.who')?.innerText !== 'Я')
.forEach(n => console.log(n.innerText));
const $items = $('.item');
const SLICE_SIZE = 3;
$('.container').append(i => $items.slice(i * SLICE_SIZE, (i + 1) * SLICE_SIZE));
$('label > input').change(function() {
$(this).parent().toggleClass('active', this.checked);
});
functional: true,
render: (h, ctx) => h('div', Array(ctx.props.количествоПовторений).fill(ctx.slots().default)),
<option
v-for="(n, i) in options"
v-text="n"
v-bind="!i && { disabled: true, value: '' }"
></option>
<option disabled value="">выбирай!</option>
<option v-for="n in options">{{ n }}</option>
Если strict не установлен, то при поиске будет использовано нестрогое сравнение.
В случае, если вы сравниваете число со строкой или две строки, содержащие числа, каждая строка будет преобразована в число, и сравниваться они будут как числа.
Значение определяется по начальной части строки. Если строка начинается с верного числового значения, будет использовано это значение. Иначе значением будет 0 (ноль).
map.events.add('boundschange', function() {
map.balloon.setPosition(map.getCenter());
});
map.events.add('actiontickcomplete', function(e) {
const { globalPixelCenter, zoom } = e.get('tick');
map.balloon.setPosition(map.options.get('projection').fromGlobalPixels(globalPixelCenter, zoom));
});