НИ
Size: a a a
НИ
A
НИ
A
'users/friends/' + username + '/remove'A
НИ
A
async fetch()
let data = api.get_user(this.user.username)
export const state = () => ({
friend_status: null,
})
export const mutations = {
set_friend_status(state, payload) {
state.friend_status = payload
},
}
export const actions = {
async friend_request_send({commit}, username) {
const {data} = await this.$axios.get('/users/friends/' + username + '/send')
commit('set_friend_status', data)
},
}A

friend_status, через :key='$store.state.friends.friend_status и перерисовывать компонент Profile целикомИ
A
A
НИ
НИ
НИ
A
this.$store.state.friends.friend_status: data() {
return {
friend_status: '',
}
},
async fetch() {
this.$store.dispatch('friends/get_friend_status', this.user.username)
// Получаем статус дружбы для пользователя в просматриваемом профиле
this.friend_status = this.$store.state.friends.friend_status
},
Но без :key кнопка на основе условия в темплейте не перерисовываетсяA
A