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 lines
2.0 KiB
1 lines
2.0 KiB
{"ast":null,"code":"import { watch, unref } from 'vue';\nimport { debugWarn } from '../../utils/error.mjs';\nconst useDeprecated = ({\n from,\n replacement,\n scope,\n version,\n ref,\n type = \"API\"\n}, condition) => {\n watch(() => unref(condition), val => {\n if (val) {\n debugWarn(scope, `[${type}] ${from} is about to be deprecated in version ${version}, please use ${replacement} instead.\nFor more detail, please visit: ${ref}\n`);\n }\n }, {\n immediate: true\n });\n};\nexport { useDeprecated };","map":{"version":3,"names":["useDeprecated","from","replacement","scope","version","ref","type","condition","watch","unref","val","debugWarn","immediate"],"sources":["../../../../../packages/hooks/use-deprecated/index.ts"],"sourcesContent":["import { unref, watch } from 'vue'\nimport { debugWarn } from '@element-plus/utils'\n\nimport type { MaybeRef } from '@vueuse/core'\n\ntype DeprecationParam = {\n from: string\n replacement: string\n scope: string\n version: string\n ref: string\n type?: 'API' | 'Attribute' | 'Event' | 'Slot'\n}\n\nexport const useDeprecated = (\n { from, replacement, scope, version, ref, type = 'API' }: DeprecationParam,\n condition: MaybeRef<boolean>\n) => {\n watch(\n () => unref(condition),\n (val) => {\n if (val) {\n debugWarn(\n scope,\n `[${type}] ${from} is about to be deprecated in version ${version}, please use ${replacement} instead.\nFor more detail, please visit: ${ref}\n`\n )\n }\n },\n {\n immediate: true,\n }\n )\n}\n"],"mappings":";;AAEY,MAACA,aAAa,GAAGA,CAAC;EAAEC,IAAI;EAAEC,WAAW;EAAEC,KAAK;EAAEC,OAAO;EAAEC,GAAG;EAAEC,IAAI,GAAG;AAAK,CAAE,EAAEC,SAAS,KAAK;EACpGC,KAAK,CAAC,MAAMC,KAAK,CAACF,SAAS,CAAC,EAAGG,GAAG,IAAK;IACrC,IAAIA,GAAG,EAAE;MACPC,SAAS,CAACR,KAAK,EAAE,IAAIG,IAAI,KAAKL,IAAI,yCAAyCG,OAAO,gBAAgBF,WAAW;AACnH,iCAAiCG,GAAG;AACpC,CAAC,CAAC;IACF;EACA,CAAG,EAAE;IACDO,SAAS,EAAE;EACf,CAAG,CAAC;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|