Replace inertia link to dashboard with regular link
This commit is contained in:
1
resources/js/app.js
vendored
1
resources/js/app.js
vendored
@@ -19,7 +19,6 @@ createInertiaApp({
|
||||
setup({el, app, props, plugin}) {
|
||||
return createApp({render: () => h(app, props)})
|
||||
.use(plugin)
|
||||
.mixin({methods: {route}})
|
||||
.use(vClickOutside)
|
||||
.use(VueMeta)
|
||||
.use(VueClipboard)
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
<template>
|
||||
<inertia-link
|
||||
:as="componentIs"
|
||||
:href="to"
|
||||
:method="method"
|
||||
class="flex items-center w-full h-10 px-6 whitespace-nowrap text-medium-emphasis text-small focus:bg-primary focus:text-on-primary hover:text-high-emphasis focus:outline-none"
|
||||
>
|
||||
<slot></slot>
|
||||
</inertia-link>
|
||||
<div class="text-medium-emphasis">
|
||||
<div v-if="componentIsInertiaLink">
|
||||
<inertia-link
|
||||
:as="componentIs"
|
||||
:href="to"
|
||||
:method="method"
|
||||
class="flex items-center w-full h-10 px-6 whitespace-nowrap text-small focus:bg-primary focus:text-on-primary hover:text-high-emphasis focus:outline-none"
|
||||
>
|
||||
<slot></slot>
|
||||
</inertia-link>
|
||||
</div>
|
||||
<div v-else>
|
||||
<a :href="to" class="flex items-center w-full h-10 px-6 whitespace-nowrap text-small focus:bg-primary focus:text-on-primary hover:text-high-emphasis focus:outline-none">
|
||||
<slot></slot>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -23,6 +32,10 @@ export default {
|
||||
method: {
|
||||
required: false,
|
||||
default: 'get'
|
||||
},
|
||||
componentIsInertiaLink: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</DropdownListItem>
|
||||
<DropdownListItem v-if="$page.props.settings.billing" :to="route('profile.billing.index')">{{ __('Billing') }}
|
||||
</DropdownListItem>
|
||||
<DropdownListItem class="!text-danger" component-is="a" v-if="$page.props.auth.user.role === 'admin'"
|
||||
<DropdownListItem class="!text-danger" :component-is-inertia-link="false" component-is="a" v-if="$page.props.auth.user.role === 'admin'"
|
||||
to="/admin">{{ __('Administration') }}
|
||||
</DropdownListItem>
|
||||
<DropdownListItem :to="route('logout')" component-is="button" method="post">{{ __('Sign out') }}
|
||||
|
||||
Reference in New Issue
Block a user