Skip to content

fix typo #2972

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

Merged
merged 1 commit into from
Oct 14, 2022
Merged
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/v2/guide/components-edge-cases.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Then inside `<google-map-markers>` you might find yourself reaching for a hack l
var map = this.$parent.map || this.$parent.$parent.map
```

This has quickly gotten out of hand. That's why to provide context information to descendent components arbitrarily deep, we instead recommend [dependency injection](#Dependency-Injection).
This has quickly gotten out of hand. That's why to provide context information to descendant components arbitrarily deep, we instead recommend [dependency injection](#Dependency-Injection).

### Accessing Child Component Instances & Child Elements

Expand Down Expand Up @@ -138,7 +138,7 @@ Earlier, when we described [Accessing the Parent Component Instance](#Accessing-

In this component, all descendants of `<google-map>` needed access to a `getMap` method, in order to know which map to interact with. Unfortunately, using the `$parent` property didn't scale well to more deeply nested components. That's where dependency injection can be useful, using two new instance options: `provide` and `inject`.

The `provide` options allows us to specify the data/methods we want to **provide** to descendent components. In this case, that's the `getMap` method inside `<google-map>`:
The `provide` options allows us to specify the data/methods we want to **provide** to descendant components. In this case, that's the `getMap` method inside `<google-map>`:

```js
provide: function () {
Expand Down Expand Up @@ -288,7 +288,7 @@ Then a `tree-folder-contents` component with this template:
</ul>
```

When you look closely, you'll see that these components will actually be each other's descendent _and_ ancestor in the render tree - a paradox! When registering components globally with `Vue.component`, this paradox is resolved for you automatically. If that's you, you can stop reading here.
When you look closely, you'll see that these components will actually be each other's descendant _and_ ancestor in the render tree - a paradox! When registering components globally with `Vue.component`, this paradox is resolved for you automatically. If that's you, you can stop reading here.

However, if you're requiring/importing components using a __module system__, e.g. via Webpack or Browserify, you'll get an error:

Expand Down