in my vue template i have this...
<template>
<div id="container">
{{show_municipality_in_words(12)}}
</div>
</template>
in my js...
export default {
data() {
},
methods: {
show_municipality_in_words(municipality_id) {
fetch(`api/biodidb/get_municipality_name_by_id/${municipality_id}`)
.then(response => response.json())
.then(result => {
console.log(result.Municipality);
return result.Municipality;
}).catch(err => {console.log(err)});
}
}
}
in html view, it returns nothing but in console it has the data.. is this the proper way of displaying it?