UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 1.54 kB
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-migrating/index.ts"],"sourcesContent":["import { getCurrentInstance, onMounted } from 'vue'\nimport { debugWarn } from '@element-plus/utils/error'\nimport { kebabCase } from '@element-plus/utils/util'\n\nconst useMigrating = function () {\n onMounted(() => {\n const instance = getCurrentInstance()!\n if (process.env.NODE_ENV === 'production') return\n if (!instance.vnode) return\n const { props = {} } = getMigratingConfig()\n const { data } = instance\n const definedProps = data.attrs || {}\n\n for (let propName in definedProps as any) {\n propName = kebabCase(propName) // compatible with camel case\n if (props[propName]) {\n debugWarn(\n 'Element Migrating',\n `[${instance.proxy?.$options.name}][Attribute]: ${props[propName]}`\n )\n }\n }\n })\n const getMigratingConfig = function () {\n return {\n props: {},\n events: {},\n }\n }\n return {\n getMigratingConfig,\n }\n}\n\nexport default useMigrating\n"],"names":[],"mappings":";;;;MAIM,eAAe,WAAY;AAC/B,YAAU,MAAM;AALlB;AAMI,UAAM,WAAW;AACjB,QAAI,QAAQ,IAAI,aAAa;AAAc;AAC3C,QAAI,CAAC,SAAS;AAAO;AACrB,UAAM,EAAE,QAAQ,OAAO;AACvB,UAAM,EAAE,SAAS;AACjB,UAAM,eAAe,KAAK,SAAS;AAEnC,aAAS,YAAY,cAAqB;AACxC,iBAAW,UAAU;AACrB,UAAI,MAAM,WAAW;AACnB,kBACE,qBACA,IAAI,eAAS,UAAT,mBAAgB,SAAS,qBAAqB,MAAM;AAAA;AAAA;AAAA;AAKhE,QAAM,qBAAqB,WAAY;AACrC,WAAO;AAAA,MACL,OAAO;AAAA,MACP,QAAQ;AAAA;AAAA;AAGZ,SAAO;AAAA,IACL;AAAA;AAAA;;;;"}