Reputation: 2153
I search to compute user.fullName with computed() in VueJS 2.
The computed property must be in user object.
computed: {
'user.fullName': () => {
return `John Doe`
}
}
It's doesn't works...
Upvotes: 2
Views: 161
Reputation: 22561
You can make user
as computed property and dynamically add fullName
to it. Real user object should be named differently:
computed: {
user: () => {
return {
...this.realUserObject,
fullName: 'John Doe'
}
}
}
Upvotes: 4