[Vuejs]-Typescript typecasting error while using vue.js

0👍

Members of TypeScript interfaces have to be semicolon delimited:

export interface User {
  id: number;
  uuid: string;
  email: string;
  name: string;
  role: number;
}

let myObject: User;
let otherObject: any;
myObject = otherObject as User;

Also, it is recommended that you also always add semicolon at the end of a statement/line, even though they are optional in JavaScript.

I also noticed that it shows an eslint error, make sure you are using tslint and not eslint.

👤XCS

Leave a comment