2
0
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:
pimlie
2019-09-13 00:08:21 +02:00
committed by Pim
parent 0e49a9c43e
commit 0ab76ee16b
27 changed files with 389 additions and 387 deletions
+5
View File
@@ -138,5 +138,10 @@ export default function createApp () {
</div>`
})
const { set } = app.$meta().addApp('custom')
set({
meta: [{ charset: 'utf-8' }]
})
return { app, router }
}
+3 -10
View File
@@ -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="/">&larr; Examples index</a>
{{ app }}
<script src="/__build__/ssr.js"></script>
{{ script.text({ body: true }) }}
{{ noscript.text({ body: true }) }}
{{ bodyAppend(true) }}
</body>
</html>
+10 -7
View File
@@ -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 = {