Modifying the HelloWorld component to support image classification

When we created our Vue application, the CLI helpfully created a HelloWorld.vue file for us containing the HelloWorld component. We are going to take advantage of the fact that we already have this component, and we are going to use it to classify a pre-loaded image. If we wanted to, we could use it to load images using a file upload component and drive the classifications when this changes.

Now, let's take a look at what our HelloWorld TypeScript code looks like. Obviously, we are going to start with a class definition. Just like we saw earlier, we have marked this with the @Component decorator to say that this is a component:

@Componentexport default class HelloWorld extends ...

Get Advanced TypeScript Programming Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.