Skip to content

Commit 5eabf44

Browse files
committed
refactor: add empty v-bind warning
re vuejs#7973
1 parent 6226503 commit 5eabf44

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/compiler/parser/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,15 @@ function processAttrs (el) {
528528
name = name.replace(bindRE, '')
529529
value = parseFilters(value)
530530
isProp = false
531+
if (
532+
process.env.NODE_ENV !== 'production' &&
533+
value.trim().length === 0
534+
) {
535+
warn(
536+
`${name}="${value}": ` +
537+
'The v-bind expression should not be empty'
538+
)
539+
}
531540
if (modifiers) {
532541
if (modifiers.prop) {
533542
isProp = true

0 commit comments

Comments
 (0)