fix(runtime-core): add useAttrs and useSlots export (#4053)

This commit is contained in:
wonderl17 2021-07-02 19:51:09 +08:00 committed by GitHub
parent 2788154f77
commit 735ada1507
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -58,7 +58,9 @@ export {
withAsyncContext,
// deprecated
defineEmit,
useContext
useContext,
useAttrs,
useSlots
} from './apiSetupHelpers'
// Advanced API ----------------------------------------------------------------

View File

@ -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<Record<string, unknown>>(attrs)
})
describe('useSlots', () => {
const slots = useSlots()
expectType<Slots>(slots)
})