$('#results').on('change', 'tr', function(e) {
console.log(e, $(this).data('xxx'));
});
function displayLine(data) {
$('#results').append($(`
<tr>
<th scope="row">${importLines.length}</th>
<td><input class="checkbox" type="checkbox"></td>
<td>${data[0]}</td>
<td>${data[2]}</td>
<td>${data[11]}</td>
<td id="status-${data[0]}"><b><span style="color: orange">PENDING</span></b></td>
</tr>
`).data('xxx', data));
}
onClickOutside(e) {
if (!this.$el.contains(e.target)) {
// закрываем дропдаун
}
},
created() {
const { onClickOutside } = this;
document.addEventListener('click', onClickOutside);
this.$on('hook:beforeDestroy', () => document.removeEventListener('click', onClickOutside));
},
if(currentSlide == 2){
this.el.style.backgroundImage = ...
photos: {
Проблема явно в строке<li v-for="array in filterBy(arrays, input)">
Я взял вот этот листинг:
https://next.vuetifyjs.com/ru/components/lists
В консоли ошибка :
[Vue warn]: Unknown custom element
нужно пройтись в сторе по массиву найти у какого объекта stepConditions.active === true ему поставить false, а следующему объекту в stepConditions.active выставить true
case OPEN_NEXT_EXPRESS_FORM_STEP:
const active = 1 + state.findIndex(n => n.stepConditions.active);
return active ? state.map((n, i) => ({
...n,
stepConditions: {
...n.stepConditions,
active: i === active,
},
})) : state;
case OPEN_NEXT_EXPRESS_FORM_STEP:
return state.map((n, i, arr) => ({
...n,
stepConditions: {
...n.stepConditions,
active: !!(i && arr[i - 1].stepConditions.active),
},
}));
arr.propertyIsEnumerable(length) // => true
$(document).on('click', '.sandwitch', function () {
if ($(window).width() < 520) {
$(this).toggleClass('sandwitch--active');
$('.main-menu-list').slideToggle();
}
});
state = { field: newField, currentPlayer: newPlayer };
Object.assign(state, { ... })
. const initialState = {
first: 0,
second: 0,
};
class CounterAction implements Action {
constructor(public type: ActionTypes, public payload: string) {}
}
function counterReducer(state = initialState, action: CounterAction) {
switch (action.type) {
case ActionTypes.Increment:
return {
...state,
[action.payload]: state[action.payload] + 1,
};
...
<div *ngFor="let item of count$ | async | keyvalue">
<button (click)="increment(item.key)">Increment</button>
<div>Current Count: {{ item.value }}</div>
<button (click)="decrement(item.key)">Decrement</button>
<button (click)="reset(item.key)">Reset Counter</button>
</div>
increment(key) {
this.store.dispatch(new CounterAction(ActionTypes.Increment, key));
}
...
function foo(...args) {
console.log(args[N]);
}
function foo() {
console.log(arguments[N]);
}
function foo(...{ [N]: x }) {
console.log(x);
}
selectedServices() {
return this.services.reduce((acc, n) => (n.checked && acc.push(n.title), acc), []);
},
<ul>
<li v-for="n in selectedServices">{{ n }}</li>
</ul>
selectedServices() {
return this.services.filter(n => n.checked);
},
<ul>
<li v-for="n in selectedServices">{{ n.title }}</li>
</ul>
sum() {
return this.selectedServices.reduce((acc, n) => acc + n.cost, 0);
},
const cards = Array.from(
document.querySelectorAll('[data-component="card"]'),
n => new Card(n)
);
constructor(el) {
if (typeof el === 'string') {
return Array.from(document.querySelectorAll(el), n => new Card(n));
}
// дальше всё по-старому
const cards = new Card('[data-component="card"]');