0

I saw several Stackoverflow questions about this but I still couldn't solve my problem about switching pages.

I import the second Vue page. Then I call this.$navigateTo() on the page I imported. I don't get any errors after executing the method. Nothing happens! The method gets executed but the page doesn't change. The path to the second page is valid.

import SecondPage from './SecondPage';   
export default {
  methods: {
    run(){
      console.log('test')
      this.$navigateTo(SecondPage)
    }
  }
}

this is the way I call the method:

<Button text="Check" @tap="run()" />

1 Answer 1

3

There is likely an error in the SecondPage.vue file. What you can try is change the $navigateTo call to have a catch statement:

import SecondPage from './SecondPage';   
export default {
  methods: {
    run(){
      console.log('test')
      this.$navigateTo(SecondPage).catch(err => console.log('There was an error!', err))
    }
  }
}

See if it gives you a clue what might be wrong.

And just to make sure, SecondPage is indeed a <Page> component? (the root element is the Page?)

Sign up to request clarification or add additional context in comments.

1 Comment

It was an error that came up on the second page. That's why it didn't get loaded all the time. Wow. So many hours wasted on nothing. Thank you very much!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.