mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-08 02:52:24 +03:00
@@ -26,8 +26,13 @@ export default function _updateClientMetaInfo (options = {}) {
|
||||
break
|
||||
// update attributes
|
||||
case 'htmlAttrs':
|
||||
updateTagAttributes(options)(newInfo[key], htmlTag)
|
||||
break
|
||||
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
|
||||
// ignore these
|
||||
case 'titleChunk':
|
||||
|
||||
@@ -16,6 +16,7 @@ export default function _generateServerInjector (options = {}) {
|
||||
return titleGenerator(options)(type, data)
|
||||
case 'htmlAttrs':
|
||||
case 'bodyAttrs':
|
||||
case 'headAttrs':
|
||||
return attrsGenerator(options)(type, data)
|
||||
default:
|
||||
return tagGenerator(options)(type, data)
|
||||
|
||||
@@ -4,7 +4,7 @@ export default function _attrsGenerator (options = {}) {
|
||||
/**
|
||||
* 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
|
||||
* @return {Object} - the attribute generator
|
||||
*/
|
||||
|
||||
@@ -36,6 +36,7 @@ export default function _getMetaInfo (options = {}) {
|
||||
titleTemplate: '%s',
|
||||
htmlAttrs: {},
|
||||
bodyAttrs: {},
|
||||
headAttrs: {},
|
||||
meta: [],
|
||||
base: [],
|
||||
link: [],
|
||||
|
||||
Reference in New Issue
Block a user