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),
},