nuxt / vue-meta

Manage HTML metadata in Vue.js components with SSR support
https://vue-meta.nuxtjs.org
Other
4.08k stars 247 forks source link

Vue3 + vue-router + vue-meta #785

Open fontcoderrrrrrr opened 2 years ago

fontcoderrrrrrr commented 2 years ago

Hi,everyone I have a question that I want to combine meta with router in vue3; But I couldn't find the API;

router.beforeEach((to, from, next) => {
  if (to.meta.metaInfo) {
    store.CAHNGE_META_INFO(to.meta.metaInfo.title);
    useMeta({
      title: to.meta.metaInfo.title,
    });
  }
  next();
});

The above code is not available. I was wondering when to insert meta information from the router into vue-meta.