S
S
sergeyviktorovich2021-01-12 14:28:23
JavaScript
sergeyviktorovich, 2021-01-12 14:28:23

Why spread syntax at the beginning of methods and how does it work in this case?

I didn’t see an example here using object methods
https://developer.mozilla.org/en-US/docs/Web/JavaS...

export default {
        name: 'App',
        data() {
            return {
                activeItemId: null,
            }
        },
        components: {
            ViewDataList,
            ViewDataItem
        },
        computed: {
            ...mapGetters(['loadStatus', 'dataItemInfo', 'currentItem', 'secondStep'])
        },
        methods: {
            ...mapActions(['loadDataItemInfo', 'moveBack']),
    
            async nextStep() {
                this.loadDataItemInfo();
            }
        }
    }
    </script>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2021-01-12
@Fragster

const a = function () {alert('hello!')}
a()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question