Пытался разными способами <...> что то явно не так
v-model="$store.state.registrations.user_email"
user_email: {
get() {
return this.$store.state.registrations.user_email;
},
set(val) {
this.$store.commit('update_user_email', val);
},
},
v-model
всегда будет разный
{ имя_свойства: значение }
и с помощью Object.assign
закидывать его в объект в стейте - так за один вызов мутации можно будет обновлять несколько свойств). balloonOffset: [ -50, -50 ]
, например), чтобы увидеть, что находится под ним, убедиться, что метка на месте. Если вдруг нет - воспроизводите свою ситуацию в песочнице, попробуем разобраться. const $select = $('select').change(function() {
const selected = $(':selected', this).get().map(n => n.value);
const disabled = $(':disabled', this).get().map(n => n.value);
$select
.not(this)
.find('option')
.prop('disabled', function(i, val) {
return disabled.includes(this.value) ? val : selected.includes(this.value);
});
});
const selects = [...document.querySelectorAll('select')];
selects.forEach(n => n.addEventListener('change', onChange));
function onChange() {
const options = [...this];
const selected = options.filter(n => n.selected).map(n => n.value);
const disabled = options.filter(n => n.disabled).map(n => n.value);
for (const n of selects.flatMap(m => m === this ? [] : [...m])) {
n.disabled = disabled.includes(n.value) ? n.disabled : selected.includes(n.value);
}
}
class="subs"
, например.$('select').change(function() {
$('.subs [class*="sub"]')
.addClass('hidden')
.filter(`.sub${$(this).val()}`)
.removeClass('hidden');
});
// или
$('select').change(function(e) {
const index = ($(e.target).prop('selectedIndex') || Infinity) - 1;
this.addClass('hidden');
this.eq(index).removeClass('hidden');
}.bind($('.subs').children()));
document.querySelector('select').addEventListener('change', e => {
const cls = `sub${e.target.value}`;
document.querySelectorAll('.subs [class*="sub"]').forEach(n => {
n.classList.toggle('hidden', !n.classList.contains(cls));
});
});
// или
document.querySelector('select').addEventListener('change', e => {
const index = ~-e.target.selectedIndex;
Array.prototype.forEach.call(
document.querySelector('.subs').children,
(n, i) => n.classList.toggle('hidden', i !== index)
);
});
const input = document.querySelector('input');
const num = 100;
input.addEventListener('change', function() {
this.value = (this.value / num | 0) * num;
});
<button data-step="-1">-</button>
<button data-step="+1">+</button>
document.querySelectorAll('[data-step]').forEach(function(n) {
n.addEventListener('click', this);
}, e => input.value = +input.value + e.target.dataset.step * num);
ng-repeat="obj in this.objects | filter: this.searchText as filtered"
ng-if="!filtered.length"
#include <iostream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
int main()
{
const int N = 6;
int m[N][N] = { 0 };
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
int x = min(min(i, j), min(N - 1 - i, N - 1 - j));
m[i][j] = N * N + 1 - (i > j
? (N - 2 * x - 2) * (N - 2 * x - 2) + (i - x) + (j - x)
: (N - 2 * x) * (N - 2 * x) - (i - x) - (j - x)
);
}
}
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
cout << setw(5) << m[i][j];
}
cout << endl;
}
return 0;
}
const inputs = document.querySelectorAll('ol input');
const classes = [...new Set(Array.prototype.flatMap.call(
inputs,
n => [...n.classList]
))];
const classes = Array
.from(inputs, n => Array.from(n.classList))
.flat();