Redirecting
Basic Usage
// wires/UserDashboard.bx
class extends="cbwire.models.Component" {
data = {
"isLoggedIn": false
};
function logout() {
// Perform logout logic
data.isLoggedIn = false;
// Redirect to login page
redirect("/login");
}
function goToProfile() {
// Navigate to profile using wire:navigate (SPA-style)
redirect("/user/profile", true);
}
function visitExternal() {
// Redirect to external URL
redirect("https://example.com");
}
}Redirect Types
Internal Pages
External URLs
Wire Navigate
Was this helpful?