i.includes(["качель","окно"])[ 'качель', 'окно' ].includes(i)const mapStateToProps = ({ list }, { params }) => ({
list: list.filter(n => n.params.some(m => params.includes(m))),
});
<div id="app" @click="onClick">
...new Vue({
el: '#app',
methods: {
onClick(e) {
if (e.target.tagName === 'A') {
e.preventDefault();
window.open(e.target.getAttribute('href'));
}
},
...
},
...
});
<div id="app">
<h1>{{ h() }}</h1>
</div>new Vue({
el: '#app',
methods: {
h() {
return Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
},
},
created() {
window.addEventListener('resize', () => this.$forceUpdate());
},
});
&.facebook &::before background-color: #3b5998 .fa color: #3b5998
&.facebook
&::before
background-color: #3b5998
color: #3b5998
function App() {
const items = Array.from({ length: 5 }, (_, i) => (
<p style={{ 'padding-left': `${i * 10}px` }}>
{Array.from(
{ length: i + 1 },
(_, j) => String.fromCharCode(j + 65)
).join('')}
</p>
));
return <div>{items}</div>;
}
const className = 'здесь должен быть класс ваших input\'ов';const inputs = document.querySelectorAll(`.${className}`);
// или
const inputs = document.getElementsByClassName(className);const values = Array.from(inputs, n => n.value);
// или
const values = Array.prototype.map.call(inputs, n => n.value);
// или
const values = [];
for (const n of inputs) {
values.push(n.value);
}
// или
const values = [];
for (let i = 0; i < inputs.length; i++) {
values[i] = inputs[i].value;
}
// или
const values = (function get(i, n = inputs.item(i)) {
return n ? [ n.value, ...get(i + 1) ] : [];
})(0);
<div v-for="(n, i) in arr" class="block-calculations__panel">
<span
:data-col="i"
:class="{ active: n.isActive }"
@click="n.isActive = !n.isActive"
></span>
</div><div v-for="(n, i) in arr" class="block-calculations__panel">
<span
:data-col="i"
:class="{ active: active === i }"
@click="active = active === i ? null : i"
></span>
</div>
Нужно вывести это все в сетку по 4 элемента в строке <...> Не понятно как перебирая массив делать строки
const { items } = this.state;
const inRow = 4;
const rows = Array.from(
{ length: Math.ceil(items.length / 4) },
(n, i) => items.slice(i * 4, (i + 1) * 4)
);{rows.map(n => (
<div className="row">
{n.map(m => <div>{m}</div>)}
</div>
))}
<input type="checkbox" :id="`checkbox-${item.key}`" :value="item.key" v-model="status">
$('.cart-window ul').each на $('.cart-window ul .item').each, а $(this).find('.item span').text() замените на $(this).find('span').text().
У меня получается создать коллекцию, но Ymaps и Map не имеют метода setBounds (выводил в console.log(ymaps) и console.log(map)).
Я хочу прямо в HTML написать <canvas id="threejs_here"> </canvas> и как-то назначить этот canvas для вывода рендера three.js<canvas ref="threejs"></canvas>new THREE.WebGLRenderer({
canvas: this.$refs.threejs,
})