You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
1.2 KiB

{"ast":null,"code":"import { getCurrentInstance, computed } from 'vue';\nconst useProp = name => {\n const vm = getCurrentInstance();\n return computed(() => {\n var _a, _b;\n return (_b = (_a = vm == null ? void 0 : vm.proxy) == null ? void 0 : _a.$props) == null ? void 0 : _b[name];\n });\n};\nexport { useProp };","map":{"version":3,"names":["useProp","name","vm","getCurrentInstance","computed","_a","_b","proxy","$props"],"sources":["../../../../../packages/hooks/use-prop/index.ts"],"sourcesContent":["import { computed, getCurrentInstance } from 'vue'\nimport type { ComputedRef } from 'vue'\n\nexport const useProp = <T>(name: string): ComputedRef<T | undefined> => {\n const vm = getCurrentInstance()\n return computed(() => (vm?.proxy?.$props as any)?.[name])\n}\n"],"mappings":";AACY,MAACA,OAAO,GAAIC,IAAI,IAAK;EAC/B,MAAMC,EAAE,GAAGC,kBAAkB,EAAE;EAC/B,OAAOC,QAAQ,CAAC,MAAM;IACpB,IAAIC,EAAE,EAAEC,EAAE;IACV,OAAO,CAACA,EAAE,GAAG,CAACD,EAAE,GAAGH,EAAE,IAAI,IAAI,GAAG,KAAK,CAAC,GAAGA,EAAE,CAACK,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAGF,EAAE,CAACG,MAAM,KAAK,IAAI,GAAG,KAAK,CAAC,GAAGF,EAAE,CAACL,IAAI,CAAC;EAChH,CAAG,CAAC;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}