first commit
This commit is contained in:
29
node_modules/vant/es/composables/use-route.mjs
generated
vendored
Normal file
29
node_modules/vant/es/composables/use-route.mjs
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import {
|
||||
getCurrentInstance
|
||||
} from "vue";
|
||||
const routeProps = {
|
||||
to: [String, Object],
|
||||
url: String,
|
||||
replace: Boolean
|
||||
};
|
||||
function route({
|
||||
to,
|
||||
url,
|
||||
replace,
|
||||
$router: router
|
||||
}) {
|
||||
if (to && router) {
|
||||
router[replace ? "replace" : "push"](to);
|
||||
} else if (url) {
|
||||
replace ? location.replace(url) : location.href = url;
|
||||
}
|
||||
}
|
||||
function useRoute() {
|
||||
const vm = getCurrentInstance().proxy;
|
||||
return () => route(vm);
|
||||
}
|
||||
export {
|
||||
route,
|
||||
routeProps,
|
||||
useRoute
|
||||
};
|
||||
Reference in New Issue
Block a user