Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(v-model): v-model ended with spaces #7735

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix(v-model): putting the value in a previous line and adding one mor…
…e condition in the test
  • Loading branch information
Leocardoso94 committed Mar 2, 2018
commit 47afa07883c7323b2792b4e62986bfeff11473ec
2 changes: 1 addition & 1 deletion src/compiler/directives/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ type ModelParseResult = {
}

export function parseModel (val: string): ModelParseResult {
len = val.length
val = val.trim()
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be above the previous line 🤔

Copy link
Author

Choose a reason for hiding this comment

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

It's true, I fixed this in the last commit

len = val.length

if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
index = val.lastIndexOf('.')
Expand Down
3 changes: 2 additions & 1 deletion test/unit/features/directives/model-text.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ describe('Directive v-model text', () => {
},
template: '<input v-model="test ">'
}).$mount()
expect(vm['test ']).toBe(undefined)
expect(vm['test ']).toBe(undefined);
expect(vm.test).toBe('b');
})

it('.lazy modifier', () => {
Expand Down