I'm having trouble in my Nuxt app. I'm mutation data through the store but get the error as soon as there 2 items in my array that I want to post in my store.
I read some similar question but It seems that it generally because of mutations made elsewhere from the store. In my case I'm using the mutation from VueX. I'm getting stuck with no idea how to fix it.
In my store:
export const namespaced = true;
export const state = () => ({
tags: null,
ratings: null,
});
const getters = {
getRatings: (state) => {
return state.ratings;
},
getTags: (state) => {
return state.tags;
},
};
const mutations = {
set_Ratings: (state, value) => {
state.ratings = value;
},
set_Tags: (state, value) => {
state.tags = value;
},
};
export default {
state,
mutations,
getters,
};
in my file (I've simplified it)
<template>
<div>
{{ followers }}
{{ getTags }}
---
<div
@click="handle"
>
Click here to add to store
</div>
</div>
</template>
<script>
import { mapMutations, mapGetters } from 'vuex';
export default {
components: {
},
data() {
return {
followers: [],
};
},
computed: {
...mapGetters({
getTags: 'filters/getTags',
}),
},
mounted() {
},
methods: {
...mapMutations({
setTag: 'filters/set_Tags',
}),
handle() {
const test = Math.random().toString(36);
this.followers.push(test);
this.setTag(this.followers);
},
},
};
</script>
<style>
</style>
I got not idea why I got this issue. Any help would be appreciated