[Vuejs]-Rename page with Apollo & Vue router

0👍

vue-apollo smart queries provide a result callback that’s called when the query completes. You can complete any actions that depend on the data, including changing the title, inside the callback. Something like:

apollo: {
  creation: {
    query: YOUR_QUERY,
    result: ({ data }) => {
      document.title = data.creation.title
    },
  }
}

Leave a comment