Skip to content

Commit 57ebc78

Browse files
authored
add is attribute to API (#917)
1 parent 8ee417b commit 57ebc78

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

src/v2/api/index.md

+26-1
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
17851785
17861786
<!-- prop binding. "prop" must be declared in my-component. -->
17871787
<my-component :prop="someThing"></my-component>
1788-
1788+
17891789
<!-- pass down parent props in common with a child component -->
17901790
<child-component v-bind="$props"></child-component>
17911791
@@ -1958,6 +1958,31 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
19581958

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

1961+
### is
1962+
1963+
- **Expects:** `string`
1964+
1965+
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).
1966+
1967+
For example:
1968+
1969+
``` html
1970+
<!-- component changes when currentView changes -->
1971+
<component v-bind:is="currentView"></component>
1972+
1973+
<!-- necessary because <my-row> would be invalid inside -->
1974+
<!-- a <table> element and so would be hoisted out -->
1975+
<table>
1976+
<tr is="my-row"></tr>
1977+
</table>
1978+
```
1979+
1980+
For detailed usage, follow the links in the description above.
1981+
1982+
- **See also:**
1983+
- [Dynamic Components](../guide/components.html#Dynamic-Components)
1984+
- [DOM Template Parsing Caveats](../guide/components.html#DOM-Template-Parsing-Caveats)
1985+
19611986
## Built-In Components
19621987

19631988
### component

0 commit comments

Comments
 (0)