Skip to content

Commit

Permalink
fix(static pages): handling multiple white spaces inside static page …
Browse files Browse the repository at this point in the history
…title

Fixed issue with handling only the first occurrence of white space in static page title

bug vuestorefront-community#154
  • Loading branch information
zmilan committed Jan 4, 2022
1 parent 3b1a813 commit 00840ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/theme/pages/Static.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ export default {
const { pageName } = $route.params;
if (pageName) {
return (pageName.charAt(0).toUpperCase() + pageName.slice(1)).replace('-', ' ');
return (pageName.charAt(0).toUpperCase() + pageName.slice(1)).replaceAll('-', ' ');
}
return 'About';
});
const changeActivePage = async (title) => {
$router.push(`/page/${(title || '').toLowerCase().replace(' ', '-')}`);
$router.push(`/page/${(title || '').toLowerCase().replaceAll(' ', '-')}`);
};
return { changeActivePage, activePage };
Expand Down

0 comments on commit 00840ba

Please sign in to comment.