-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use it with Vuejs 3 + TypeScript ? #665
Comments
Argument of type 'typeof import("E:/Ayoub Khan/Porfolios/ayoubkhan-portfolio/node_modules/vue-meta/dist/vue-meta")' is not assignable to parameter of type 'Plugin_2'.
Property 'install' is missing in type 'typeof import("E:/Ayoub Khan/Porfolios/ayoubkhan-portfolio/node_modules/vue-meta/dist/vue-meta")' but required in type '{ install: PluginInstallFunction; }'.ts(2345) |
import { createMetaManager } from "vue-meta";
...
const metaManager = createMetaManager();
app.use(metaManager).mount("#app"); |
Just added a types entry in package.json, that was missing in versions before alpha.4. |
I needed to do 6 things:
@pimlie - Please correct me if I missed something or if a step is unnecessary! |
@charles-allen Thanks for the detailed log, this seems to be ok. Returning |
Thanks for the feedback! I've updated my project & fixed the example above. I've also added a vanilla Vue 3 version for people not using |
Have a look at the docs on the new alpha tag > https://github.com/nuxt/vue-meta/tree/v3.0.0-alpha.5 Works out of the box. |
|
I'm working on a Vue 3 project that uses the options API with the help of An example use case: let's suppose your route is /articles/some-article. Before the article is loaded, we only know the slug ( |
@ataylor32 - I'm not using My code is using export default class Profile extends Vue.with(class {
slug!: string
}) {
user: User | null = null
meta = setup(() => useMeta(computed(() => ({
title: this.user?.name ?? 'Profile'
}))))
async mounted(): Promise<void> {
this.user = (await db.collection(USERS).doc(this.slug).get()).data() as (User | undefined) ?? null
}
} |
How would you use og or twitter meta tags with metaInfo?
^^ This does not work. Also, is there an elegant way to use the same value for multiple fields (like
|
@Sirius-KiH With the default vue-meta configuration opengraph & twitter can be added by using nested objects. description: description,
og: {
description: ogDescription,
},
twitter: {
description: twitterDescription,
} then in the component you could do: <template v-slot:og(description)="{ content, metainfo }">{{ content || metainfo.description }}</template>
<template v-slot:twitter(description)="{ content, metainfo }">{{ content || metainfo.description }}</template> this way if |
Thanks for your contribution to vue-meta! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you would like this issue to remain open:
|
why Am i still getting that error...:
|
@romain130492 You need to update the version - |
What is the latest update on the Vue 3 support? Documentation is very sparse, not quite sure how to migrate the old version to this one |
Thanks for your contribution to vue-meta! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you would like this issue to remain open:
|
For anybody showing up later searching, this project is no longer maintained ( #808 ) and suggest looking at using something like https://github.com/unjs/unhead/ |
How to use it with Vuejs 3 + TypeScript ?
The text was updated successfully, but these errors were encountered: