Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/compiler/parser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ function processAttrs (el) {
if (bindRE.test(name)) { // v-bind
name = name.replace(bindRE, '')
value = parseFilters(value)
isProp = false
if (modifiers) {
if (modifiers.prop) {
isProp = true
Expand Down
12 changes: 12 additions & 0 deletions test/unit/features/directives/bind.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,18 @@ describe('Directive v-bind', () => {
expect(vm.$el.children[1].innerHTML).toBe('<span>qux</span>')
})

it('.prop modifier with normal attribute bind', () => {
const vm = new Vue({
template: '<input :some.prop="some" :id="id">',
data: {
some: 'hello',
id: 'world'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the test case should use a null or false value and check that the id attribute is absent on the element

Copy link
Member Author

@defcc defcc Dec 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I updated the test case

}
}).$mount()
expect(vm.$el.some).toBe('hello')
expect(vm.$el.getAttribute('id')).toBe('world')
})

it('.camel modifier', () => {
const vm = new Vue({
template: '<svg :view-box.camel="viewBox"></svg>',
Expand Down