Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromvuejs/vue

Commit183bd43

Browse files
defccyyx990803
authored andcommitted
fix v-bind.prop parse (fixvuejs#4432) (vuejs#4435)
* reset isProp value* add test case* update test case* fix typo
1 parent962b778 commit183bd43

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+
constvm=newVue({
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
constvm=newVue({
126138
template:'<svg :view-box.camel="viewBox"></svg>',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp