Skip to content

Commit b1c0d7f

Browse files
asolopovaskazupon
authored andcommitted
Fix v-model section (vuejs#813)
Hi, v-model section requires extra line to make this code complete. Otherwise it causes a problem: ``` render: function (createElement) { var self = this return createElement('input', { domProps: { value: self.value }, on: { input: function (event) { self.value = event.target.value // This line should be added self.$emit('input', event.target.value) } } }) } ``` Otherwise the value is updated in the one way. Please see example http://codepen.io/asolopovas/pen/OpWVxa?editors=1011
1 parent 955e771 commit b1c0d7f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/v2/guide/render-function.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ render: function (createElement) {
296296
on: {
297297
input: function (event) {
298298
self.value = event.target.value
299+
self.$emit('input', event.target.value)
299300
}
300301
}
301302
})

0 commit comments

Comments
 (0)