I have this sample of code experimenting with mixins in TypeScript. However, it is not returning what I am expecting. It should give me: User ({“id”:3,”name”:”Lorenzo Delaurentis”}). Instead, I am getting: Function ({“id”:3,”name”:”Lorenzo Delaurentis”}). The line let Name = Class.constructor.name should give me User, but it is not. Am I missing something obvious here? P.S. I compiled with tsc mixins
Tag: mixins
How to use mixins in Nuxt.js app with nuxt-property-decortor
I have used Nuxt.js in my latest project, and the language is TypeScript. Also, I’m using nuxt-property-decorator. I’m trying to understand the ‘mixins’ property in the following code. mixins.vue ↓ mixin.ts↓ I was expecting “Hello worlds!” in the output, but an error occurred: Could anyone advise me? Answer The mixin must be decorated with @Component: