mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-20 04:50:34 +03:00
feat: add possibility to add additional meta info
refactor: server injectors feat: add head, bodyPrepend, bodyAppend injectors refactor: create browserbuild through rollup replace (not separate entry)
This commit is contained in:
@@ -138,5 +138,10 @@ export default function createApp () {
|
||||
</div>`
|
||||
})
|
||||
|
||||
const { set } = app.$meta().addApp('custom')
|
||||
set({
|
||||
meta: [{ charset: 'utf-8' }]
|
||||
})
|
||||
|
||||
return { app, router }
|
||||
}
|
||||
|
||||
@@ -1,23 +1,16 @@
|
||||
<!doctype html>
|
||||
<html {{ htmlAttrs.text(true) }}>
|
||||
<head {{ headAttrs.text() }}>
|
||||
{{ title.text() }}
|
||||
{{ meta.text() }}
|
||||
{{ head(true) }}
|
||||
<link rel="stylesheet" href="/global.css">
|
||||
{{ link.text() }}
|
||||
{{ style.text() }}
|
||||
{{ script.text() }}
|
||||
{{ noscript.text() }}
|
||||
</head>
|
||||
<body {{ bodyAttrs.text() }}>
|
||||
{{ script.text({ pbody: true }) }}
|
||||
{{ noscript.text({ pbody: true }) }}
|
||||
{{ bodyPrepend(true) }}
|
||||
|
||||
<a href="/">← Examples index</a>
|
||||
{{ app }}
|
||||
|
||||
<script src="/__build__/ssr.js"></script>
|
||||
{{ script.text({ body: true }) }}
|
||||
{{ noscript.text({ body: true }) }}
|
||||
{{ bodyAppend(true) }}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -64,13 +64,6 @@ const router = new Router({
|
||||
|
||||
const App = {
|
||||
router,
|
||||
metaInfo () {
|
||||
return {
|
||||
meta: [
|
||||
{ charset: 'utf=8' }
|
||||
]
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<div id="app">
|
||||
<h1>vue-router</h1>
|
||||
@@ -86,7 +79,17 @@ const App = {
|
||||
|
||||
const app = new Vue(App)
|
||||
|
||||
const { set, remove } = app.$meta().addApp('custom')
|
||||
|
||||
set({
|
||||
meta: [
|
||||
{ charset: 'utf=8' }
|
||||
]
|
||||
})
|
||||
setTimeout(() => remove(), 3000)
|
||||
|
||||
app.$mount('#app')
|
||||
|
||||
/*
|
||||
const waitFor = time => new Promise(r => setTimeout(r, time || 1000))
|
||||
const o = {
|
||||
|
||||
Reference in New Issue
Block a user