1
votes

I'm trying to redirect to another page with the click of a button, but for some reason it's not working, I'm not sure why?

Currently it opens up a window inside the main page not even a real redirect but it's blank. If I change the link to something else like just "/" or another page like "/users" then it works, but just for this link it's not working.

This is how I'm redirecting in the vue

<inertia-link href="imports/teachers">
    <el-button type="warning">Import</el-button>
</inertia-link>

In my web.php

Route::resource('imports/teachers', 'ImportTeacherController');

In the controller

public function index()
{
    return Inertia::render('Import/Teacher');
}

In the teacher.vue I have a very basic layout

<template>
    <layout>
        <div>
            <h1>Page Title</h1>
        </div>
    </layout>
</template>
1

1 Answers

0
votes

<inertia-link href="imports/teachers"> -> <inertia-link href="/imports/teachers">

You are missing a / before imports. It's just the same with normal anchor tags, you should add a leading /.