element-plus/packages/hooks/use-global-config/index.ts
msidolphin 66043aa3b5
refactor(components): [el-config-provider] improve componomponent extendiability (#4175)
re #4146

added button configuration
added useGlobalConfig hook
2021-11-05 18:10:07 +08:00

14 lines
352 B
TypeScript

import { inject } from 'vue'
import { configProviderContextKey } from '@element-plus/tokens'
import type { ConfigProvdierContext } from '@element-plus/tokens'
const defaultConfig: ConfigProvdierContext = {
button: {
autoInsertSpace: true,
},
}
export const useGlobalConfig = () => {
return inject(configProviderContextKey, defaultConfig)
}