Use data-* for vue-meta (valid markup)

- data-*
- remove defer for __NUXT__ script
This commit is contained in:
Sébastien Chopin 2017-03-24 01:24:50 +01:00
parent 64f83b71c3
commit 5102e819fe
2 changed files with 4 additions and 4 deletions

View File

@ -20,8 +20,8 @@ Vue.component(Nuxt.name, Nuxt)
// vue-meta configuration
Vue.use(Meta, {
keyName: 'head', // the component option name that vue-meta looks for meta info on.
attribute: 'n-head', // the attribute name vue-meta adds to the tags it observes
ssrAttribute: 'n-head-ssr', // the attribute name that lets vue-meta know that meta info has already been server-rendered
attribute: 'data-n-head', // the attribute name vue-meta adds to the tags it observes
ssrAttribute: 'data-n-head-ssr', // the attribute name that lets vue-meta know that meta info has already been server-rendered
tagIDKeyName: 'hid' // the property name that vue-meta uses to determine whether to overwrite or append a tag
})

View File

@ -101,9 +101,9 @@ export function renderRoute (url, context = {}) {
HEAD += `<base href="${self.options.router.base}">`
}
HEAD += context.styles
APP += `<script type="text/javascript" defer>window.__NUXT__=${serialize(context.nuxt, { isJSON: true })}</script>`
APP += `<script type="text/javascript">window.__NUXT__=${serialize(context.nuxt, { isJSON: true })}</script>`
const html = self.appTemplate({
HTML_ATTRS: 'n-head-ssr ' + m.htmlAttrs.text(),
HTML_ATTRS: 'data-n-head-ssr ' + m.htmlAttrs.text(),
BODY_ATTRS: m.bodyAttrs.text(),
HEAD,
APP