File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## useAttrs() {#useattrs}
4
4
5
- 从 [ Setup 上下文] ( /api/composition-api-setup#setup-context ) 中返回 ` attrs ` 对象,其中包含当前组件的[ 透传 attributes] ( /guide/components/attrs#fallthrough-attributes ) 。这是用于 ` <script setup> ` 中的,因为在 ` <script setup> ` 中无法获取 setup 上下文对象的 。
5
+ 从 [ Setup 上下文] ( /api/composition-api-setup#setup-context ) 中返回 ` attrs ` 对象,其中包含当前组件的[ 透传 attributes] ( /guide/components/attrs#fallthrough-attributes ) 。这是用于 ` <script setup> ` 中的,因为在 ` <script setup> ` 中无法获取 setup 上下文对象 。
6
6
7
7
- ** 类型**
8
8
12
12
13
13
## useSlots () {#useslots }
14
14
15
- 从 [Setup 上下文](/ api / composition - api - setup #setup - context )中返回 ` slots ` 对象,其中包含父组件传递的插槽。这些插槽为可调用的函数,返回虚拟 DOM 节点。这是用于 ` <script setup> ` 中的,因为在 ` <script setup> ` 中无法获取 setup 上下文对象的 。
15
+ 从 [Setup 上下文](/ api / composition - api - setup #setup - context )中返回 ` slots ` 对象,其中包含父组件传递的插槽。这些插槽为可调用的函数,返回虚拟 DOM 节点。这是用于 ` <script setup> ` 中的,因为在 ` <script setup> ` 中无法获取 setup 上下文对象 。
16
16
17
17
如果使用 TypeScript ,建议优先使用 [` defineSlots() ` ](/ api / sfc - script - setup #defineslots )。
18
18
You can’t perform that action at this time.
0 commit comments