Skip to content

Commit d80f82b

Browse files
committed
Add docs about slots in template
1 parent ec3a66e commit d80f82b

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

docs/concepts/custom-templates.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ proxy:
6969
awesome.happen:
7070
ref: "awesome-brick"
7171
refEvent: "something.happen"
72+
# Now we recommend to define `slot` element (since brick_next 3.19.13), instead of `proxy.slots`
7273
slots:
7374
tools:
7475
ref: "micro-view"
@@ -96,6 +97,10 @@ bricks:
9697
# Use `targetRef` to point to another brick inside a custom template.
9798
targetRef: "micro-view"
9899
method: "updateView"
100+
# Define a slot
101+
- brick: slot
102+
properties:
103+
name: extra
99104
```
100105
101106
在 Storyboard 中使用:
@@ -127,9 +132,10 @@ slots:
127132

128133
## 变更历史 {#history}
129134

130-
| 组件 | 版本 | 变更 |
131-
| ---------- | ----- | ------------------------------------------------------------------------------------------------ |
132-
| brick_next | 3.0.0 | 移除废弃用法: `proxy.properties.{refTransform}` `extraOneWayRefs` `mergeProperty` `<% TPL.* %>` |
135+
| 组件 | 版本 | 变更 |
136+
| ---------- | ------- | ------------------------------------------------------------------------------------------------ |
137+
| brick_next | 3.19.13 | 支持在模板内部定义 slot 元素 |
138+
| - | 3.0.0 | 移除废弃用法: `proxy.properties.{refTransform}` `extraOneWayRefs` `mergeProperty` `<% TPL.* %>` |
133139

134140
[context 上下文]: context.md
135141
[template state 模板状态数据]: template-state.md

i18n/zh/docusaurus-plugin-content-docs/current/concepts/custom-templates.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ proxy:
6969
awesome.happen:
7070
ref: "awesome-brick"
7171
refEvent: "something.happen"
72+
# 现在推荐直接在模板内部定义 `slot` 元素 (brick_next 3.19.13 开始支持),而不是设置 `proxy.slots`
7273
slots:
7374
tools:
7475
ref: "micro-view"
@@ -96,6 +97,10 @@ bricks:
9697
# Use `targetRef` to point to another brick inside a custom template.
9798
targetRef: "micro-view"
9899
method: "updateView"
100+
# Define a slot
101+
- brick: slot
102+
properties:
103+
name: extra
99104
```
100105
101106
在 Storyboard 中使用:
@@ -127,9 +132,10 @@ slots:
127132

128133
## 变更历史 {#history}
129134

130-
| 组件 | 版本 | 变更 |
131-
| ---------- | ----- | ------------------------------------------------------------------------------------------------ |
132-
| brick_next | 3.0.0 | 移除废弃用法: `proxy.properties.{refTransform}` `extraOneWayRefs` `mergeProperty` `<% TPL.* %>` |
135+
| 组件 | 版本 | 变更 |
136+
| ---------- | ------- | ------------------------------------------------------------------------------------------------ |
137+
| brick_next | 3.19.13 | 支持在模板内部定义 slot 元素 |
138+
| - | 3.0.0 | 移除废弃用法: `proxy.properties.{refTransform}` `extraOneWayRefs` `mergeProperty` `<% TPL.* %>` |
133139

134140
[context 上下文]: context.md
135141
[template state 模板状态数据]: template-state.md

0 commit comments

Comments
 (0)