Help with auto redirection

I need help. i am new to Ionic Vue, i at an intermediate level in PHP. I am trying to learn how i can implement a simple project. I AM TRYING TO MAKE IT SIMPLE

  1. Create a login page,
      <form @submit.prevent="submitForm">  
          <ion-input type="text" placeholder="Username" v-model="username" required />
            <br />
          <ion-input type="password" placeholder="Password" v-model="password" required />
            <br />
          <ion-button type="submit" expand="block" shape="round">Login</ion-button>
          <button class="forgot"> Forgot Password? </button>
  1. after a user clicks the submit button, then call an API to verify the details with my MySQL server
data() {
    return {
      username: null,
      password: null,
      serverResponse: []

methods: {
    submitForm() {
      this.AuthenticateWithServer([this.username, this.password]);

    async AuthenticateWithServer(inputs) {
      try {
        const result = await axios.get(`${inputs[0]}&password=${inputs[1]}`);
        this.serverResponse =; 
          case 200:
          case 400: 
            this.showToast("Oops! it seems you have entered wrong username or password");
          case 500: 
            this.showToast("Oops! please provide your details to login");
      } catch(e) {
        this.showToast("Seems you are not connected to Internet");

  1. if the response is “200”, I want to redirect to another page, say, dashboard. so on the in loginSuccessful(), i am calling this code but its not working
loginSuccessful() {

but it’s not redirecting even if the response is 200…

Please help, how can i do it better

Use router component

can you give a basic example code please, if you dont mind