diff --git a/CHANGELOG.md b/CHANGELOG.md index a64a77a..23ab2e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,95 @@ All notable changes to this project will be documented in this file. See [standa ## [3.0.0-alpha.0](https://github.com/nuxt/vue-meta/compare/v2.3.3...v3.0.0-alpha.0) (2021-01-25) +The first alpha release for vue-meta v3 supporting Vue 3, basic functionality should work but needs lots more testing. Don't use this in production. Help with squashing bugs would be appreciated. + +### Quick overview of features + +#### useApi + +See ./examples/vue-router for a working example + +```js +import { watch } from 'vue' +import { useMeta, useMetainfo } from 'vue-meta' + +export default { + setup () { + // add meta info. The object passed into useMeta is configurable + const { meta } = useMeta({ + title: 'My Title' + }) + + // get the currently used metainfo + const metadata = useMetainfo() + + watch(metadata, (newValue) => { + // metadata was updated, do something + }) + } +} +``` + +#### SSR + +See ./examples/ssr for a working example + +```js +import { createSSRApp } from 'vue' +import { renderToStringWithMeta } from 'vue-meta' +import { App, metaManager } from './App' + +export function renderPage() { + const app = createSSRApp(App) + app.use(metaManager) + + const [appHtml, ctx] = await renderToStringWithMeta(app) + + return ` + +
+ ${ctx.teleports.head || ''} + + +