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

fix: also render boolean attributes correctly for tags

This commit is contained in:
pimlie
2019-02-11 15:59:01 +01:00
parent deea5cfbbd
commit 66e4fb4e3e
2 changed files with 9 additions and 11 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import { tagsWithoutEndTag, tagsWithInnerContent, tagAttributeAsInnerContent } from '../../shared/constants'
import { booleanHtmlAttributes, tagsWithoutEndTag, tagsWithInnerContent, tagAttributeAsInnerContent } from '../../shared/constants'
import { isUndefined } from '../../shared/typeof'
/**
@@ -36,7 +36,7 @@ export default function tagGenerator({ attribute, tagIDKeyName } = {}, type, tag
prefix = 'data-'
}
return isUndefined(tag[attr])
return isUndefined(tag[attr]) || booleanHtmlAttributes.includes(attr)
? `${attrsStr} ${prefix}${attr}`
: `${attrsStr} ${prefix}${attr}="${tag[attr]}"`
}, '')