2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-18 23:10:33 +03:00

feat: append tag into body

This commit is contained in:
Clark Du
2017-11-02 20:53:25 +08:00
parent 1813a8e2d0
commit 8602d5060c
3 changed files with 15 additions and 6 deletions
+2 -1
View File
@@ -10,9 +10,10 @@ export default function _tagGenerator (options = {}) {
*/
return function tagGenerator (type, tags) {
return {
text () {
text ({inBody = false} = {}) {
// build a string containing all tags of this type
return tags.reduce((tagsStr, tag) => {
if (!!tag.inBody !== inBody) return tagsStr
// build a string containing all attributes of this tag
const attrs = Object.keys(tag).reduce((attrsStr, attr) => {
switch (attr) {