mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-23 11:50:34 +03:00
@@ -26,8 +26,13 @@ export default function _updateClientMetaInfo (options = {}) {
|
|||||||
break
|
break
|
||||||
// update attributes
|
// update attributes
|
||||||
case 'htmlAttrs':
|
case 'htmlAttrs':
|
||||||
|
updateTagAttributes(options)(newInfo[key], htmlTag)
|
||||||
|
break
|
||||||
case 'bodyAttrs':
|
case 'bodyAttrs':
|
||||||
updateTagAttributes(options)(newInfo[key], key === 'htmlAttrs' ? htmlTag : document.getElementsByTagName('body')[0])
|
updateTagAttributes(options)(newInfo[key], document.getElementsByTagName('body')[0])
|
||||||
|
break
|
||||||
|
case 'headAttrs':
|
||||||
|
updateTagAttributes(options)(newInfo[key], document.getElementsByTagName('head')[0])
|
||||||
break
|
break
|
||||||
// ignore these
|
// ignore these
|
||||||
case 'titleChunk':
|
case 'titleChunk':
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export default function _generateServerInjector (options = {}) {
|
|||||||
return titleGenerator(options)(type, data)
|
return titleGenerator(options)(type, data)
|
||||||
case 'htmlAttrs':
|
case 'htmlAttrs':
|
||||||
case 'bodyAttrs':
|
case 'bodyAttrs':
|
||||||
|
case 'headAttrs':
|
||||||
return attrsGenerator(options)(type, data)
|
return attrsGenerator(options)(type, data)
|
||||||
default:
|
default:
|
||||||
return tagGenerator(options)(type, data)
|
return tagGenerator(options)(type, data)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export default function _attrsGenerator (options = {}) {
|
|||||||
/**
|
/**
|
||||||
* Generates tag attributes for use on the server.
|
* Generates tag attributes for use on the server.
|
||||||
*
|
*
|
||||||
* @param {('bodyAttrs'|'htmlAttrs')} type - the type of attributes to generate
|
* @param {('bodyAttrs'|'htmlAttrs'|'headAttrs')} type - the type of attributes to generate
|
||||||
* @param {Object} data - the attributes to generate
|
* @param {Object} data - the attributes to generate
|
||||||
* @return {Object} - the attribute generator
|
* @return {Object} - the attribute generator
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ export default function _getMetaInfo (options = {}) {
|
|||||||
titleTemplate: '%s',
|
titleTemplate: '%s',
|
||||||
htmlAttrs: {},
|
htmlAttrs: {},
|
||||||
bodyAttrs: {},
|
bodyAttrs: {},
|
||||||
|
headAttrs: {},
|
||||||
meta: [],
|
meta: [],
|
||||||
base: [],
|
base: [],
|
||||||
link: [],
|
link: [],
|
||||||
|
|||||||
Reference in New Issue
Block a user