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

feat(useTitle): useTitle composable #331

Merged
merged 12 commits into from
May 31, 2020
Merged

feat(useTitle): useTitle composable #331

merged 12 commits into from
May 31, 2020

Conversation

pikax
Copy link
Owner

@pikax pikax commented May 29, 2020

relates #317

Returns title ref, it will be kept up to date with the current header, it relies on MutationObserver to keep header updated 97.5%

const title = useTitle(defaultTiltle);

title.value = 'update title'

Example

Also added SSR support for v3:

const app = createSSRApp(Comp);
const title = provideSSRTitle(app, 'my title') // send app to the method
const htmlContent = await app.renderToString(el)
// title has the last title set

@pikax pikax added the composable New composable label May 31, 2020
@pikax pikax merged commit 42670d3 into master May 31, 2020
@pikax pikax deleted the feat/useTitle branch May 31, 2020 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
composable New composable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant