2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-10 07:42:26 +03:00

feat: don't generate title tag if title is empty (#334)

* fix: not generate title tag if title is empty

* fix: align title to document.title api

* refactor: trim data
This commit is contained in:
Xin Du (Clark)
2019-03-28 12:30:29 +00:00
committed by Pim
parent 27429652ce
commit 2141bab00c
+1 -1
View File
@@ -11,7 +11,7 @@ export default function _titleGenerator (options = {}) {
return function titleGenerator (type, data) {
return {
text () {
return `<${type} ${attribute}="true">${data}</${type}>`
return String(data).trim() ? `<${type} ${attribute}="true">${data}</${type}>` : ''
}
}
}