Skip to content

Commit 825c21b

Browse files
committed
2.6: v-slot api entry
1 parent 70c7b63 commit 825c21b

File tree

1 file changed

+54
-32
lines changed

1 file changed

+54
-32
lines changed

src/v2/api/index.md

Lines changed: 54 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,6 +2213,26 @@ type: api
22132213
- [Form Input Bindings](../guide/forms.html)
22142214
- [Components - Form Input Components using Custom Events](../guide/components.html#Form-Input-Components-using-Custom-Events)
22152215

2216+
### v-slot
2217+
2218+
- **Shorthand:** `#`
2219+
2220+
- **Expects:** JavaScript expression that is valid in a function argument position (supports destructuring in [supported environments](../guide/components-slots.html#Slot-Props-Destructuring)). Optional - only needed if expecting props to be passed to the slot.
2221+
2222+
- **Argument:** `slot name (optional)`
2223+
2224+
- **Limited to:**
2225+
- `<template>`
2226+
- components (when denoting default slot with props)
2227+
2228+
- **Usage:**
2229+
2230+
Denote named slots or slots that expect to receive props. For detailed usage, see the links below.
2231+
2232+
- **See also:**
2233+
- [Components - Slots](../guide/components-slots.html)
2234+
- [RFC-0001](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0001-new-slot-syntax.md)
2235+
22162236
### v-pre
22172237

22182238
- **Does not expect expression**
@@ -2332,38 +2352,6 @@ type: api
23322352
23332353
- **See also:** [Child Component Refs](../guide/components.html#Child-Component-Refs)
23342354
2335-
### slot
2336-
2337-
- **Expects:** `string`
2338-
2339-
Used on content inserted into child components to indicate which named slot the content belongs to.
2340-
2341-
For detailed usage, see the guide section linked below.
2342-
2343-
- **See also:** [Named Slots](../guide/components.html#Named-Slots)
2344-
2345-
### slot-scope
2346-
2347-
> New in 2.5.0+
2348-
2349-
- **Expects:** `function argument expression`
2350-
2351-
- **Usage:**
2352-
2353-
Used to denote an element or component as a scoped slot. The attribute's value should be a valid JavaScript expression that can appear in the argument position of a function signature. This means in supported environments you can also use ES2015 destructuring in the expression. Serves as a replacement for [`scope`](#scope-replaced) in 2.5.0+.
2354-
2355-
This attribute does not support dynamic binding.
2356-
2357-
- **See also:** [Scoped Slots](../guide/components.html#Scoped-Slots)
2358-
2359-
### scope <sup>replaced</sup>
2360-
2361-
Used to denote a `<template>` element as a scoped slot, which is replaced by [`slot-scope`](#slot-scope) in 2.5.0+.
2362-
2363-
- **Usage:**
2364-
2365-
Same as [`slot-scope`](#slot-scope) except that `scope` can only be used on `<template>` elements.
2366-
23672355
### is
23682356
23692357
- **Expects:** `string | Object (component’s options object)`
@@ -2389,6 +2377,40 @@ Used to denote a `<template>` element as a scoped slot, which is replaced by [`s
23892377
- [Dynamic Components](../guide/components.html#Dynamic-Components)
23902378
- [DOM Template Parsing Caveats](../guide/components.html#DOM-Template-Parsing-Caveats)
23912379
2380+
### slot <sup>replaced</sup>
2381+
2382+
**Replaced by [v-slot](#v-slot) since 2.6.0.**
2383+
2384+
- **Expects:** `string`
2385+
2386+
Used on content inserted into child components to indicate which named slot the content belongs to.
2387+
2388+
- **See also:** [Named Slots with `slot`](../guide/components.html#Named-Slots-with-slot)
2389+
2390+
### slot-scope <sup>replaced</sup>
2391+
2392+
**Replaced by [v-slot](#v-slot) since 2.6.0.**
2393+
2394+
- **Expects:** `function argument expression`
2395+
2396+
- **Usage:**
2397+
2398+
Used to denote an element or component as a scoped slot. The attribute's value should be a valid JavaScript expression that can appear in the argument position of a function signature. This means in supported environments you can also use ES2015 destructuring in the expression. Serves as a replacement for [`scope`](#scope-replaced) in 2.5.0+.
2399+
2400+
This attribute does not support dynamic binding.
2401+
2402+
- **See also:** [Scoped Slots with `slot-scope`](../guide/components.html#Scoped-Slots-with-slot-scope)
2403+
2404+
### scope <sup>replaced</sup>
2405+
2406+
**Replaced by [slot-scope](#slot-scope) since 2.5.0.**
2407+
2408+
Used to denote a `<template>` element as a scoped slot.
2409+
2410+
- **Usage:**
2411+
2412+
Same as [`slot-scope`](#slot-scope) except that `scope` can only be used on `<template>` elements.
2413+
23922414
## Built-In Components
23932415

23942416
### component

0 commit comments

Comments
 (0)