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

fix: add warning for v1 boolean attribute syntax

This commit is contained in:
pimlie
2019-06-22 16:50:23 +02:00
parent be5f1d0d55
commit bfeab1754e
2 changed files with 37 additions and 1 deletions
+5 -1
View File
@@ -1,7 +1,7 @@
import deepmerge from 'deepmerge'
import { findIndex } from '../utils/array'
import { applyTemplate } from './template'
import { metaInfoAttributeKeys } from './constants'
import { metaInfoAttributeKeys, booleanHtmlAttributes } from './constants'
export function arrayMerge({ component, tagIDKeyName, metaTemplateKeyName, contentKeyName }, target, source) {
// we concat the arrays without merging objects contained in,
@@ -80,6 +80,10 @@ export function merge(target, source, options = {}) {
for (const key in source[attrKey]) {
if (source[attrKey].hasOwnProperty(key) && source[attrKey][key] === undefined) {
if (booleanHtmlAttributes.includes(key)) {
// eslint-disable-next-line no-console
console.warn('VueMeta: Please note that since v2 the value undefined is not used to indicate boolean attributes anymore, see migration guide for details')
}
delete source[attrKey][key]
}
}