isItemsReady
в модуле с значением false, после того как данные стянулись и сохранились, тригерите его в true. Это вам понадобиться на страницах/компонентах, чтобы узнать что данные готовы, можно пока isItemsReady
false крутить спиннер.items: { return this.$store.getters.items }
props: {
value: [String, Number, Object, Array]
}
data() {
return {
mutableValue: this.value
};
}
<li v-for="(item, index) in items" @click="foo(item)">{{ `item ${index + 1}` }}</li>
const defaultButton = this.buttons.find(btn => btn.default); // найдет объект
const defaultButtons = this.buttons.filter(btn => btn.default); // массив с найденными объектами
<template>
<button @click="throttledMethod()">Click me as fast as you can!</button>
</template>
<script>
import _ from 'lodash'
export default {
methods: {
throttledMethod: _.debounce(() => {
console.log('I only get fired once every two seconds, max!')
}, 2000)
}
}
</script>
this.$store.commit('CONCAT_ITEMS', data);
<style src="./style.css"></style>
<template src="./template.html"></template>
<script src="./script.js"></script>
methods: {
setRandomClass(word, index) {
return some class here;
}
}
<div v-for="(word, index) in element.value.split('')" :class="[setRandomClass(word, index)]"></div
methods: {
search: debounce(function () {
console.log(this.query);
}, 1000),
},