Skip to content

Commit

Permalink
feat(router): add props support to refreshPage method
Browse files Browse the repository at this point in the history
fixes #4103
  • Loading branch information
nolimits4web committed Dec 16, 2022
1 parent 8d34259 commit e6fc0c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/core/modules/router/navigate.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import processRouteQueue from './process-route-queue.js';
import appRouterCheck from './app-router-check.js';
import asyncComponent from './async-component.js';

function refreshPage() {
function refreshPage(props = {}) {
const router = this;
appRouterCheck(router, 'refreshPage');
return router.navigate(router.currentRoute.url, {
ignoreCache: true,
reloadCurrent: true,
props,
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/modules/router/router.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export namespace Router {
/** Go back to previous page, going back in View history */
back(url?: string, options?: RouteOptions): Router;
/** Refresh/reload current page */
refreshPage(): Router;
refreshPage(props?: any): Router;
/** Clear router previous pages history and remove all previous pages from DOM */
clearPreviousHistory(): Router;
/** Updates current route url, and updates `router.currentRoute` properties (query, params, hash, etc.) based on passed url. This method doesn't load or reload any content. It just changes current route url */
Expand Down

0 comments on commit e6fc0c0

Please sign in to comment.