Answer the question
In order to leave comments, you need to log in
How to keep the state of one vue component (keep-alive) with different inputs?
There is a component that displays a list of users with whom correspondence was conducted. As well as the second component of the chat for personal correspondence.
When a user is selected, a method is called that passes input parameters (props) to vue-router and opens a component with a chat.
openPrivateUserChat(user) {
this.$router.push({
name: 'PrivateUserChat',
params: {user_id: user.id}
});
}
axios.post('/api/getMessagesForUser', {
user_id: this.user_id,
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question