diff --git a/src/client/updateClientMetaInfo.js b/src/client/updateClientMetaInfo.js
index bc4906e..5978cfd 100644
--- a/src/client/updateClientMetaInfo.js
+++ b/src/client/updateClientMetaInfo.js
@@ -1,10 +1,23 @@
import updateTitle from './updaters/updateTitle'
import updateTagAttributes from './updaters/updateTagAttributes'
+import updateTags from './updaters/updateTags'
import { SERVER_RENDERED_ATTRIBUTE } from '../shared/constants'
+// tags to watch
+const tags = [
+ 'meta',
+ 'link',
+ 'base',
+ 'style',
+ 'script',
+ 'noscript'
+]
+
+// hoisted vars but only in the browser
if (typeof window !== 'undefined' && window !== null) {
var htmlTag = document.getElementsByTagName('html')[0]
var bodyTag = document.getElementsByTagName('body')[0]
+ var headTag = document.getElementsByTagName('head')[0]
}
/**
@@ -23,6 +36,14 @@ export default function updateClientMetaInfo (newInfo, $root) {
// update
attrs
updateTagAttributes(newInfo.bodyAttrs, bodyTag)
+
+ // update tags
+ for (let i = 0, len = tags.length; i < len; i++) {
+ const tag = tags[i]
+ if (newInfo[tag]) {
+ updateTags(tag, newInfo[tag], headTag)
+ }
+ }
} else {
htmlTag.removeAttribute(SERVER_RENDERED_ATTRIBUTE)
}
diff --git a/src/client/updaters/updateTags.js b/src/client/updaters/updateTags.js
new file mode 100644
index 0000000..3db1dbd
--- /dev/null
+++ b/src/client/updaters/updateTags.js
@@ -0,0 +1,59 @@
+import { VUE_META_ATTRIBUTE } from '../../shared/constants'
+
+// borrow the slice method
+const toArray = Function.prototype.call.bind(Array.prototype.slice)
+
+/**
+ * Updates meta tags inside on the client. Borrowed from `react-helmet`:
+ * https://github.com/nfl/react-helmet/blob/004d448f8de5f823d10f838b02317521180f34da/src/Helmet.js#L195-L245
+ *
+ * @param {('meta'|'base'|'link'|'style'|'script'|'noscript')} type - the name of the tag
+ * @param {(Array