index.mjs 573 B

123456789101112131415161718192021222324
  1. import { watch, unref } from 'vue';
  2. import { debugWarn } from '../../utils/error.mjs';
  3. const useDeprecated = ({ from, replacement, scope, version, ref, type = "API" }, condition) => {
  4. watch(
  5. () => unref(condition),
  6. (val) => {
  7. if (val) {
  8. debugWarn(
  9. scope,
  10. `[${type}] ${from} is about to be deprecated in version ${version}, please use ${replacement} instead.
  11. For more detail, please visit: ${ref}
  12. `
  13. );
  14. }
  15. },
  16. {
  17. immediate: true
  18. }
  19. );
  20. };
  21. export { useDeprecated };
  22. //# sourceMappingURL=index.mjs.map