UNPKG

ivue-material-plus

Version:

A high quality UI components Library with Vue.js

1 lines 788 B
{"version":3,"file":"index.mjs","sources":["../../../../../src/hooks/use-prop/index.ts"],"sourcesContent":["import { computed, getCurrentInstance } from 'vue';\r\n\r\n// type\r\nimport type { ComputedRef } from 'vue';\r\n\r\nexport const useProp = <T>(name: string): ComputedRef<T | undefined> => {\r\n const vm = getCurrentInstance()!;\r\n\r\n return computed(() => (vm.proxy?.$props as any)[name] ?? undefined);\r\n};\r\n"],"names":[],"mappings":";;AAKa,MAAA,OAAA,GAAU,CAAI,IAA6C,KAAA;AACtE,EAAA,MAAM,KAAK,kBAAmB,EAAA,CAAA;AAE9B,EAAA,OAAO,SAAS,MAAG;AARrB,IAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AAQyB,IAAA,OAAA,CAAA,EAAA,GAAA,CAAA,CAAA,EAAA,GAAA,EAAA,CAAG,KAAH,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAU,MAAe,EAAA,IAAA,CAAA,KAAzB,IAAkC,GAAA,EAAA,GAAA,KAAA,CAAA,CAAA;AAAA,GAAS,CAAA,CAAA;AACpE;;;;"}