Tips & Snippets

Get some good Tips & Snippets here on the Code Editor in Vev

Navigating to a page in Vev

To navigate to a page in Vev by pageKey, add this in your Widget function code.

const [route, dispatch] = useGlobalStore((store, dispatch) => [store.route, dispatch]);
function navigate(vevPageKey:string) {
dispatch('route', {pageKey: vevPageKey:string});
// window.history.pushState(null, null, window.location.pathname);
// You may want to adjust window.history as well, depending on use-case
}