Answer the question
In order to leave comments, you need to log in
What is the correct way to use Vue/Vuex to move the id of one element to another on click?
Good afternoon!
Please help me orient myself.
There is a list:
<ul class="tabel-day_menu-type">
<li v-for='(type,i) in types'
:key="type.id"
@click="set_type(type)"
>
<span class="icon">
{{ type.icon }}
</span>
<span class="icon_text">{{ type.text }}</span>
</li>
</ul>
<table class="table">
<tbody>
<tr>
<day-component
тут разные атрибуты для компонента
></day-component>
</tr>
</tbody>
</table>
const store = new Vuex.Store({....
mutations: {...}
});
Vue.component('day-component',{...
computed: {
selected() {
// собираем все выбранные ячейки и присваиваем им значение true
return this.days_selected[ get_day_id([this.day_index, this.w, this.u]) ] === true;
}
});
var a = new Vue({...
methods: {...}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question