я что-то не так делаю видно
<div class="container">
<input maxlength="10">
</div>
const container = document.querySelector('.container');
const input = container.querySelector('input').cloneNode();
container.addEventListener('input', ({ target: t }) => {
if (t.value.length === +t.maxLength) {
const nextInput = t.nextElementSibling || input.cloneNode();
t.insertAdjacentElement('afterend', nextInput);
nextInput.focus();
}
});
const a = v1 => {
const f = v2 => a(v1 + v2);
f.valueOf = () => v1;
return f;
};
a(1)(2)(3)(4)(5) * 6 // 90
10 + a(4)(5)(6) // 25
Math.pow(a(8)(1), 3) // 729
a(4)(6) - a(3) // 7
file['selected'] = true
this.$set(file, 'selected', true)
Переписал код с ES5 на ES6
data: () => ({
show: false
})
<button @click="show = !show">{{ show ? 'hide' : 'show' }}</button>
<my-component v-if="show"></my-component>
data: () => ({
items: []
}),
methods: {
add() {
this.items.push(...);
}
}
<button @click="add">add</button>
<my-component v-for="n in items"></my-component>
const adjacentElementsProduct = arr => arr
.sort((a, b) => a - b)
.slice(-2)
.reduce((acc, n) => acc * n, 1);
const fileIndex = this.files.indexOf(fileInArr);
this.$set(this.files, fileIndex, response.data);
input:focus::placeholder {
color: transparent;
}