Skip to content

Commit 8600e33

Browse files
committed
docs for partial
1 parent f89e6b9 commit 8600e33

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

source/api/elements.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Alternative syntax for invoking components. Primarily used for dynamic component
1818

1919
### content
2020

21-
`<content>` tags serve as content insertion outlets in component templates. It optionally accepts a `select` attribute, which should be a valid CSS selector to be used to match a subset of inserted content to be displayed:
21+
`<content>` tags serve as content insertion outlets in component templates. The `<content>` element itself will be replaced. It optionally accepts a `select` attribute, which should be a valid CSS selector to be used to match a subset of inserted content to be displayed:
2222

2323
``` html
2424
<!-- only display <li>'s in the inserted content -->
@@ -29,7 +29,12 @@ The select attribute can also contain mustache expressions. For more details, se
2929

3030
### partial
3131

32-
`<partial>` tags serve as outlets for registered partials. Partial contents are also compiled by Vue when inserted. It requires a `name` attribute to be provided. For example:
32+
`<partial>` tags serve as outlets for registered partials. Partial contents are also compiled by Vue when inserted. The `<partial>` element itself will be replaced. It requires a `name` attribute to be provided. For example:
33+
34+
``` js
35+
// registering a partial
36+
Vue.partial('my-partial', '<p>This is a partial! {{msg}}</p>')
37+
```
3338

3439
``` html
3540
<!-- a static partial -->

source/api/global-api.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ Register or retrieve a global component. For more details see [Component System]
127127

128128
Register or retrieve a global JavaScript transition effect definition. For more details see the guide for [JavaScript Transitions](/guide/transitions.html#JavaScript_Functions).
129129

130+
### Vue.partial( id, [partial] )
131+
132+
- **id** `String`
133+
- **partial** `String` *optional*
134+
135+
Register or retrieve a global template partial string. For more details see [Partial](/api/elements.html#partial).
136+
130137
### Vue.use( plugin, [args...] )
131138

132139
- **plugin** `Object` or `Function`

source/api/options.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,12 @@ A hash of components to be made available to the Vue instance. For details on ho
322322

323323
A hash of transitions to be made available to the Vue instance. For details see the guide on [Transitions](/guide/transitions.html).
324324

325+
### partials
326+
327+
- **Type:** `Object`
328+
329+
A hash of partial strings to be made available to the Vue instance. For details see [Partial](/api/elements.html#partial).
330+
325331
## Others
326332

327333
### inherit

0 commit comments

Comments
 (0)