Skip to content

Add is attribute to API, fixes #804 #917

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
May 20, 2017
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
27 changes: 26 additions & 1 deletion src/v2/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1785,7 +1785,7 @@ All lifecycle hooks automatically have their `this` context bound to the instanc

<!-- prop binding. "prop" must be declared in my-component. -->
<my-component :prop="someThing"></my-component>

<!-- pass down parent props in common with a child component -->
<child-component v-bind="$props"></child-component>

Expand Down Expand Up @@ -1958,6 +1958,31 @@ All lifecycle hooks automatically have their `this` context bound to the instanc

- **See also:** [Named Slots](../guide/components.html#Named-Slots)

### is

- **Expects:** `string`

Used for [dynamic components](../guide/components.html#Dynamic-Components) and to work around [limitations of in-DOM templates](../guide/components.html#DOM-Template-Parsing-Caveats).

For example:

``` html
<!-- component changes when currentView changes -->
<component v-bind:is="currentView"></component>

<!-- necessary because <my-row> would be invalid inside -->
<!-- a <table> element and so would be hoisted out -->
<table>
<tr is="my-row"></tr>
</table>
```

For detailed usage, follow the links in the description above.

- **See also:**
- [Dynamic Components](../guide/components.html#Dynamic-Components)
- [DOM Template Parsing Caveats](../guide/components.html#DOM-Template-Parsing-Caveats)

## Built-In Components

### component
Expand Down