Skip to content
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

vue-meta in ssr #802

Open
hakimov-dev opened this issue Apr 27, 2023 · 1 comment
Open

vue-meta in ssr #802

hakimov-dev opened this issue Apr 27, 2023 · 1 comment

Comments

@hakimov-dev
Copy link

hakimov-dev commented Apr 27, 2023

image

Someone can explain which app file or folder ?

@nicolas-t
Copy link

Depends on you setup, but with vue 2 you likely have a main.js looking like this :

import Vue from 'vue'
import VueMeta from 'vue-meta'

import { createRouter } from './router'
import { createStore } from './store'
import App from './App.vue'

Vue.use(VueMeta)

export function createApp() {
    const router = createRouter()
    const store = createStore()

    const app = new Vue({
        name: 'root',
        render: (el) => el(App),
        router,
        store,
    })

    return {
        app,
        router,
        store,
    }
}

You can then access app like this :

    const { app, router, store } = createApp()
    const meta = app.$meta()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants