Skip to content

Commit 47451ec

Browse files
fix: fixes vuejs#422 with correct parameter
1 parent 4b80f94 commit 47451ec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/guide/component-basics.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ const App = {
141141
}
142142
}
143143

144-
const app = Vue.createApp({})
144+
const app = Vue.createApp(App)
145145

146146
app.component('blog-post', {
147147
props: ['title'],
@@ -340,7 +340,7 @@ Now `v-model` should work perfectly with this component:
340340

341341
Another way of creating the `v-model` capability within a custom component is to use the ability of `computed` properties' to define a getter and setter.
342342

343-
In the following example, we refactor the `custom-input` component using a computed property.
343+
In the following example, we refactor the `custom-input` component using a computed property.
344344

345345
Keep in mind, the `get` method should return the `modelValue` property, or whichever property is being using for binding, and the `set` method should fire off the corresponding `$emit` for that property.
346346

@@ -355,7 +355,8 @@ app.component('custom-input', {
355355
get() {
356356
return this.modelValue
357357
},
358-
set(value) { this.$emit('update:modelValue', value)
358+
set(value) {
359+
this.$emit('update:modelValue', value)
359360
}
360361
}
361362
}

0 commit comments

Comments
 (0)