mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-18 10:59:10 +08:00
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>
|
||
|
}
|