Skip to content

Update built-in meta component API section #300

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
Sep 23, 2020
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
12 changes: 10 additions & 2 deletions src/api/built-in-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

- **Props:**

- `is` - `string | ComponentDefinition | ComponentConstructor`
- `is` - `string | Component`

- **Usage:**

A "meta component" for rendering dynamic components. The actual component to render is determined by the `is` prop:
A "meta component" for rendering dynamic components. The actual component to render is determined by the `is` prop. An `is` prop as a string could be either an HTML tag name or a Component name.

- **Example:**

```html
<!-- a dynamic component controlled by -->
Expand All @@ -17,6 +19,12 @@

<!-- can also render registered component or component passed as prop -->
<component :is="$options.components.child"></component>

<!-- can reference components by string -->
<component :is="condition ? 'FooComponent' : 'BarComponent'"></component>

<!-- can be used to render native HTML elements -->
<component :is="href ? 'a' : 'span'"></component>
```

- **See also:** [Dynamic Components](../guide/component-dynamic-async.html)
Expand Down