feat(Link): add as prop (#535)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
Haytham A. Salama
2023-09-16 22:50:55 +03:00
committed by GitHub
parent 00594ea59b
commit e40491208a
2 changed files with 11 additions and 5 deletions

View File

@@ -1,7 +1,13 @@
<template>
<button v-if="!to" :type="type" :disabled="disabled" v-bind="$attrs" :class="inactiveClass">
<component
:is="as"
v-if="!to"
:disabled="disabled"
v-bind="$attrs"
:class="inactiveClass"
>
<slot />
</button>
</component>
<NuxtLink
v-else
v-slot="{ route, href, target, rel, navigate, isActive, isExactActive, isExternal }"
@@ -32,9 +38,9 @@ export default defineComponent({
inheritAttrs: false,
props: {
...NuxtLink.props,
type: {
as: {
type: String,
default: null
default: 'button'
},
disabled: {
type: Boolean,