From 156ffd112d5587ebef5bc121a797f675362900ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=A3=8A?= Date: Fri, 2 Jul 2021 16:06:52 +0800 Subject: [PATCH 1/2] fix(runtime-core): add useAttrs and useSlots export --- packages/runtime-core/src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/index.ts b/packages/runtime-core/src/index.ts index 572daf25482..7425056afe0 100644 --- a/packages/runtime-core/src/index.ts +++ b/packages/runtime-core/src/index.ts @@ -58,7 +58,9 @@ export { withAsyncContext, // deprecated defineEmit, - useContext + useContext, + useAttrs, + useSlots } from './apiSetupHelpers' // Advanced API ---------------------------------------------------------------- From 1c2442074eb1ef028bbe2492870c3b6d392942dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=A3=8A?= Date: Fri, 2 Jul 2021 17:03:56 +0800 Subject: [PATCH 2/2] fix(runtime-core): add useAttrs and useSlots test --- test-dts/setupHelpers.test-d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test-dts/setupHelpers.test-d.ts b/test-dts/setupHelpers.test-d.ts index dd99b85d148..e9a584f4145 100644 --- a/test-dts/setupHelpers.test-d.ts +++ b/test-dts/setupHelpers.test-d.ts @@ -4,6 +4,8 @@ import { defineEmit, defineEmits, useContext, + useAttrs, + useSlots, withDefaults, Slots, describe @@ -134,3 +136,13 @@ describe('useContext', () => { emit('foo') emit('bar') }) + +describe('useAttrs', () => { + const attrs = useAttrs() + expectType>(attrs) +}) + +describe('useSlots', () => { + const slots = useSlots() + expectType(slots) +})