Skip to content

Commit 183bd43

Browse files
defccyyx990803
authored andcommitted
fix v-bind.prop parse (fix vuejs#4432) (vuejs#4435)
* reset isProp value * add test case * update test case * fix typo
1 parent 962b778 commit 183bd43

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/compiler/parser/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ function processAttrs (el) {
414414
if (bindRE.test(name)) { // v-bind
415415
name = name.replace(bindRE, '')
416416
value = parseFilters(value)
417+
isProp = false
417418
if (modifiers) {
418419
if (modifiers.prop) {
419420
isProp = true

test/unit/features/directives/bind.spec.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,18 @@ describe('Directive v-bind', () => {
121121
expect(vm.$el.children[1].innerHTML).toBe('<span>qux</span>')
122122
})
123123

124+
it('.prop modifier with normal attribute binding', () => {
125+
const vm = new Vue({
126+
template: '<input :some.prop="some" :id="id">',
127+
data: {
128+
some: 'hello',
129+
id: false
130+
}
131+
}).$mount()
132+
expect(vm.$el.some).toBe('hello')
133+
expect(vm.$el.getAttribute('id')).toBe(null)
134+
})
135+
124136
it('.camel modifier', () => {
125137
const vm = new Vue({
126138
template: '<svg :view-box.camel="viewBox"></svg>',

0 commit comments

Comments
 (0)