Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

[Bug]: Routing Issue #24

Open
MotionPhix opened this issue Jan 17, 2024 · 0 comments
Open

[Bug]: Routing Issue #24

MotionPhix opened this issue Jan 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@MotionPhix
Copy link

What happened?

Firstly, thanks for fixing the tapping into Vue ecosystem issue. Now, I have discovered yet another issue when I try to navigate programmatically, say from a component, it does not happen. I have a component set up like below:

<?php

namespace App\View\Components;

use Illuminate\View\Component;
use ProtoneMedia\SpladeCore\Attributes\Vue;

class TestComponent extends Component
{
    #[Vue]
    public function visit(string $route_name)
    {
        redirect()->route($route_name);
    }

    public function render()
    {
        return view('components.test-component');
    }
}

And the frontend looking like:

<script setup>
// the rest of the code removed for brevity
</script>

<button @click="visit('dashboard')">Go to dashboard</button>

The expected behaviour was for the component to redirect me to the dashboard, but it does not. It just remains there like nothing hapened

How to reproduce the bug

In a new Laravel project, install splade-core and then try to navigate using a splade-core component (like a component that utilizes Vue 3 from the backend)

Package Version

2.4.0

PHP Version

8.2.0

Laravel Version

10.3

Which operating systems does with happen with?

No response

Notes

No response

@MotionPhix MotionPhix added the bug Something isn't working label Jan 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant