Created
February 25, 2021 13:46
-
-
Save itwondersteam/3a2c502436190e673c3fd2ffdb0d313f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export interface IUser { | |
| id?: number; | |
| email: string; | |
| first_name: string; | |
| last_name: string; | |
| avatar: string; | |
| } | |
| export class UserDTO implements IUser{ | |
| id?: number; | |
| avatar: string = ''; | |
| email: string = ''; | |
| first_name: string = ''; | |
| last_name: string = ''; | |
| } | |
| export default class User extends UserDTO { | |
| constructor(dto: UserDTO){ | |
| super(); | |
| Object.assign(this, dto); | |
| } | |
| get fullName(): string { | |
| return `${this.first_name} ${this.last_name}`; | |
| } | |
| } | |
| /// User.ts |
Author
itwondersteam
commented
Feb 25, 2021
Author
<v-list-item :key="index" v-for="(user, index) in users">
{{user.fullName}}
</v-list-item>
/// HomeComponent.vue - html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment