mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
8 lines
261 B
TypeScript
8 lines
261 B
TypeScript
import { computed, getCurrentInstance } from 'vue'
|
|
import type { ComputedRef } from 'vue'
|
|
|
|
export const useProp = <T>(name: string): ComputedRef<T | undefined> => {
|
|
const vm = getCurrentInstance()
|
|
return computed(() => (vm?.proxy?.$props as any)?.[name])
|
|
}
|