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 22
33## useAttrs() {#useattrs}
44
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 上下文对象 。
66
77- ** 类型**
88
1212
1313## useSlots () {#useslots }
1414
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 上下文对象 。
1616
1717如果使用 TypeScript ,建议优先使用 [` defineSlots() ` ](/ api / sfc - script - setup #defineslots )。
1818
You can’t perform that action at this time.
0 commit comments