#7 setup for a getter

This commit is contained in:
CPSO 2020-06-28 02:50:45 +02:00
parent eed2fb5b43
commit 819e99e7a5
2 changed files with 23 additions and 2 deletions

View file

@ -10,6 +10,14 @@
<br>
<h1 class="title is-5">{{ $t("Modules.About.PlexPoCredits") }}</h1>
<div class="container">
<div class="notification">
{{ poTranslators }}
</div>
</div>
@ -22,9 +30,15 @@
export default {
name: 'about',
methods: {
}, created() {
this.$store.dispatch('fetchPOEContrib');
this.$store.getters.poTranslators
}, computed: {
poTranslators(){
console.log(this.$store.getters.poTranslators)
console.log('computed:contrip'+this.$store.getters.getContrip)
return this.$store.getters.getContrip
}
}
}

View file

@ -23,7 +23,6 @@ const actions = {
'Content-Type': 'application/x-www-form-urlencoded'
}
}
axios.post('https://api.poeditor.com/v2/contributors/list', qs.stringify(requestBody), config)
.then((response) => {
console.log(response)
@ -43,6 +42,14 @@ const actions = {
}
const getters = {
getTranslators: state => {
state.contributors.forEach(element => {
return element.name
});
},
getContrip: state => state.contributors,
};
const serverModule = {