Framework7 Vue - How to use history and clearPreviousHistory in router.navigate?

Hello,

I’m looking to exclude/remove a page from history when I quit from it with $f7router.navigate.

Trying to use history: false it seems to have any effect

          this.$f7router.navigate({
            name: "task-detail",
            params: {
              taskId: this.task.id, 
              history : false,
            }
          });

I’ve also tested clearPreviousHistory: true but $vm0.$f7router.history still contain the full history also with the page I want to exclude.

What is the right way to exclude a page from history?

Thank you for your help.

Correct syntax is the following:

this.$f7router.navigate(
  {
    name: "task-detail",
    params: {
      taskId: this.task.id, 
    }
  },
  {
    clearPreviousHistory: true,
  },
);
1 Like

Many thanks, @nolimits4web, you are right. I was in error.

Using:

this.$f7router.navigate(
  {
    name: "task-detail",
    params: {
      taskId: this.task.id, 
    }
  },
  {
    history: false,
  },
);

after routing to the new page, router history didn’t save the url.

image

But the behavior is not as I expect.

I expect to load the last item in the history
image

But the application still loads the page that I want to exclude (and that is not present in the history).