mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-15 01:41:20 +08:00
c8d65bf43d
- Add a component for providing configs - Add `use-locale` hooks into hooks for composable usage - Add `use-locale` for `config-provider` to allow user to provide locale config via `react-like` API - Add test cases against these new features
14 lines
351 B
TypeScript
14 lines
351 B
TypeScript
import type { App, DefineComponent } from 'vue'
|
|
import type { SFCWithInstall } from './types'
|
|
|
|
/* istanbul ignore next */
|
|
export default <T>(component: T) => {
|
|
(component as any).install = (app: App) => {
|
|
app.component(
|
|
((component as unknown) as DefineComponent).name,
|
|
component,
|
|
)
|
|
}
|
|
return component as SFCWithInstall<T>
|
|
}
|