element-plus/packages/hooks/use-form-item/index.ts

12 lines
286 B
TypeScript
Raw Normal View History

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 {
2021-11-06 03:41:04 +08:00
form,
formItem,
}
}