diff --git a/src/guide/introduction.md b/src/guide/introduction.md
index 93cef89efb..301adefe22 100644
--- a/src/guide/introduction.md
+++ b/src/guide/introduction.md
@@ -52,7 +52,7 @@ const Counter = {
Vue.createApp(Counter).mount('#counter')
```
-We have already created our very first Vue app! This looks pretty similar to rendering a string template, but Vue has done a lot of work under the hood. The data and the DOM are now linked, and everything is now **reactive**. How do we know? Take a look at the example below where `counter` property increments every second and you will see how rendered DOM changes:
+We have already created our very first Vue app! This looks pretty similar to rendering a string template, but Vue has done a lot of work under the hood. The data and the DOM are now linked, and everything is now **reactive**. How do we know? Take a look at the example below where the `counter` property increments every second and you will see how the rendered DOM changes:
```js{8-10}
const Counter = {
@@ -158,7 +158,7 @@ Vue.createApp(TwoWayBinding).mount('#two-way-binding')
## Conditionals and Loops
-It's easy to toggle the presence of an element, too:
+It's easy to toggle the presence of an element too:
```html
@@ -220,7 +220,7 @@ The component system is another important concept in Vue, because it's an abstra

-In Vue, a component is essentially an instance with pre-defined options. Registering a component in Vue is straightforward: we create a component object as we did with `App` objects and we define it in parent's `components` option:
+In Vue, a component is essentially an instance with pre-defined options. Registering a component in Vue is straightforward: we create a component object as we did with the `app` object and we define it in the parent's `components` option:
```js
const TodoItem = {
@@ -251,10 +251,10 @@ Now you can compose it in another component's template:
But this would render the same text for every todo, which is not super interesting. We should be able to pass data from the parent scope into child components. Let's modify the component definition to make it accept a [prop](component-basics.html#passing-data-to-child-components-with-props):
```js
-app.component('todo-item', {
+const TodoItem = {
props: ['todo'],
template: `
{{ todo.text }}`
-})
+}
```
Now we can pass the todo into each repeated component using `v-bind`:
@@ -278,6 +278,11 @@ Now we can pass the todo into each repeated component using `v-bind`:
```
```js
+const TodoItem = {
+ props: ['todo'],
+ template: `{{ todo.text }}`
+}
+
const TodoList = {
data() {
return {
@@ -287,22 +292,20 @@ const TodoList = {
{ id: 2, text: 'Whatever else humans are supposed to eat' }
]
}
+ },
+ components: {
+ TodoItem
}
}
const app = Vue.createApp(TodoList)
-app.component('todo-item', {
- props: ['todo'],
- template: `{{ todo.text }}`
-})
-
app.mount('#todo-list-app')
```
-This is a contrived example, but we have managed to separate our app into two smaller units, and the child is reasonably well-decoupled from the parent via the props interface. We can now further improve our `` component with more complex template and logic without affecting the parent app.
+This is a contrived example, but we have managed to separate our app into two smaller units, and the child is reasonably well-decoupled from the parent via the props interface. We can now further improve our `` component with a more complex template and logic without affecting the parent app.
In a large application, it is necessary to divide the whole app into components to make development manageable. We will talk a lot more about components [later in the guide](component-basics.html), but here's an (imaginary) example of what an app's template might look like with components: