Skip to content

Commit

Permalink
Merge pull request #56 from chenjiahan/docs_slots
Browse files Browse the repository at this point in the history
docs: Add usage of slots and v-html
  • Loading branch information
nickmessing authored May 8, 2019
2 parents f62dc33 + 2fa8bc9 commit ef44334
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,34 @@ render() {
}
```

### Slots

named slots:

```jsx
render() {
return (
<MyComponent>
<header slot="header">header</header>
<footer slot="footer">footer</footer>
</MyComponent>
)
}
```

scoped slots:

```jsx
render() {
const scopedSlots = {
header: () => <header>header</header>,
footer: () => <footer>footer</footer>
}

return <MyComponent scopedSlots={scopedSlots} />
}
```

### Directives

```jsx
Expand All @@ -112,6 +140,12 @@ with an argument and modifiers:
<input vOn:click_stop_prevent="newTodoText" />
```

v-html:

```jsx
<p domPropsInnerHTML={html} />
```

### Functional Components

Transpiles arrow functions that return JSX into functional components, when they are either default exports:
Expand Down

0 comments on commit ef44334

Please sign in to comment.