element-plus/packages/hooks/use-form-item/index.ts
三咲智子 c72679e4e9
refactor(components)!: refactor form (#5401)
* refactor(components): refactor form

* refactor: resolve PR comments

* refactor(components): refactor isNested

* refactor: resolve PR comments
2022-03-06 22:20:56 +08:00

12 lines
286 B
TypeScript

import { inject } from 'vue'
import { formContextKey, formItemContextKey } from '@element-plus/tokens'
export const useFormItem = () => {
const form = inject(formContextKey, undefined)
const formItem = inject(formItemContextKey, undefined)
return {
form,
formItem,
}
}