S
S
sergeyviktorovich2020-12-28 20:44:02
JavaScript
sergeyviktorovich, 2020-12-28 20:44:02

What do 3 dots in front of a function mean in vue template?

import { mapActions, mapGetters } from 'vuex';

export default {
    name: 'ViewDataList',
    props: {
        status: String,
    },
    computed: {
        ...mapGetters(['dataList', 'currentItem'])
    },
    methods: {
        ...mapActions(['loadData', 'setCurrentItem', 'moveBack', 'loadDataItemInfo', 'resetQuery']),

        selectItem(event) {
            const id = event.target.dataset.id;
            this.setCurrentItem(id);

            if (this.status == 'modal') {
                this.loadDataItemInfo();
            }
        },

        resetItem() {
            this.resetQuery();
        },

        nextStep() {
            this.$emit('nextStep');
        }
    },
    created() {
        this.loadData();
    },
}

Answer the question

In order to leave comments, you need to log in

3 answer(s)
0
0xD34F, 2020-12-28
@sergeyviktorovich

This means you don't know js .
And in general - poorly understand the meaning of the words you use. What template, what are you? The vue template is html that compiles to a render function. What did you show?

R
Roman Sarvarov, 2021-01-12
@megakor

mapActions and mapGetters (and often also mapState and mapMutations) are Vuex methods that allow you to access the vuex store functionality in the context of the current component. In fact, it only makes the code more beautiful.
For example, in your example, there is loadData in mapActions. In this case, you can simply refer to this.loadData();
If without this, you would have to write such a long and ugly code: Read the Vuex documentation. this.$store.dispatch('loadData');

D
Daniil Basmanov, 2017-03-02
@Pickto

Apparently, your Camera.main is null, you can check it with a debugger. If it is null, then your camera does not have the MainCamera tag, set it, and it should work. Or drag the camera to the script through the inspector or code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question