Hi guys, in this lesson we will implement user logging components and we have to implement it. We will call user service methods from login components. Then we will implement templates for all of it. First of all, we will import users. Later we will import user model class. Later we will create already in view to create local variables we will use view data parts are first variable will be users.
Our last variable will be loaded. Then component is mounted. First of all we will check whether current user is exists or not. If it is exist, we will redirect it to homepage. Mounted function is automatically called after component is mounted. Now we can create our methods.
To create methods in view. We will use methods function block our function is handle log In this function, we will call user service login function. But first of all, we will win the login form data. At the end of it, we will send it to user service then we will eliminate to profile page Now we can create login HTML for templates block is used to render HTML. We will create the login HTML form and we will submit this form with our handle login function. We should notice in this HTML form, in view, we can relate input fields V is the object like we model user username.
The other thing is form events. We used submit attributes in HTML form, because this is typical HTML form and we worked on JavaScript. In view we can add if expression with V if tak s final things, we will implement style block. This will be a typical CSS implementation. Then we will describe our custom CSS functions Okay, that's all at the end of it login for me and with displayed like that. Thank you