use-route-726f0d0b.js 500 B

1234567891011121314151617181920212223242526
  1. import { g as getCurrentInstance } from "./index-5e4623ce.js";
  2. const routeProps = {
  3. to: [String, Object],
  4. url: String,
  5. replace: Boolean
  6. };
  7. function route({
  8. to,
  9. url,
  10. replace,
  11. $router: router
  12. }) {
  13. if (to && router) {
  14. router[replace ? "replace" : "push"](to);
  15. } else if (url) {
  16. replace ? location.replace(url) : location.href = url;
  17. }
  18. }
  19. function useRoute() {
  20. const vm = getCurrentInstance().proxy;
  21. return () => route(vm);
  22. }
  23. export {
  24. routeProps as r,
  25. useRoute as u
  26. };