Skip to content

Commit 54835cc

Browse files
committed
docs: Add usage of slots and v-html
1 parent f62dc33 commit 54835cc

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,28 @@ render() {
8888
}
8989
```
9090

91+
### Slots
92+
93+
named slots:
94+
95+
```jsx
96+
<MyComponent>
97+
<header slot="header">header</header>
98+
<footer slot="footer">footer</footer>
99+
</MyComponent>
100+
```
101+
102+
scoped slots:
103+
104+
```jsx
105+
const scopedSlots = {
106+
header: () => <header>header</header>,
107+
footer: () => <footer>footer</footer>
108+
}
109+
110+
<MyComponent scopedSlots={scopedSlots} />
111+
```
112+
91113
### Directives
92114

93115
```jsx
@@ -112,6 +134,12 @@ with an argument and modifiers:
112134
<input vOn:click_stop_prevent="newTodoText" />
113135
```
114136

137+
v-html:
138+
139+
```jsx
140+
<p domPropsInnerHTML={html} />
141+
```
142+
115143
### Functional Components
116144

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

0 commit comments

Comments
 (0)