The issue is that this.resources is initialized as an object, but you're trying to push to it as if it were an array. Instead, you should initialize it as an array and push new objects to it. Here's an updated version of your code:
<script>
export default {
data(){
return {
roleName: null,
roleFees: null,
resources: [],
}
},
methods: {
newRole(){
axios.post(`/role/create`, {
role: this.roleName,
fees: this.roleFees
}).then(response => {
Object.keys(response.data).forEach(data => {
this.resources.push({
[data]: {
role: response.data[data].role,
fees: response.data[data].fees,
}
});
});
})
},
},
mounted(){
}
}
</script>
This code initializes this.resources as an empty array, and then pushes new objects to it that have a key of data and a value of an object with role and fees properties. The resulting array should have the structure you're looking for.