Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button with as doesn't work for NuxtLink #6180

Closed
frasza opened this issue Aug 3, 2024 · 3 comments
Closed

Button with as doesn't work for NuxtLink #6180

frasza opened this issue Aug 3, 2024 · 3 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@frasza
Copy link

frasza commented Aug 3, 2024

Describe the bug

Creating a Button with as: 'NuxtLink' doesn't seem to work. If I use router-link it works.

Example:

<Button
   as="NuxtLink"
   label="Click"
   :to="{ name: 'index' }"
/>

Reproducer

PrimeVue version

4.0.4

Vue version

4.x

Language

TypeScript

Build / Runtime

Nuxt

Browser(s)

Chrome

Steps to reproduce the behavior

No response

Expected behavior

No response

@frasza frasza added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 3, 2024
@mertsincan
Copy link
Member

Button uses <component :is="as" structure so, this is related to nuxtjs; nuxt/nuxt#13659

@frasza
Copy link
Author

frasza commented Aug 3, 2024

@mertsincan I see, thank. Altho, if I set

<script lang="ts" setup>
const NuxtLink = resolveComponent('NuxtLink')
</script>
<template>
            <Button
              :as="NuxtLink"
              label="Click"
              :to="{ name: 'index' }"
            />
</template

I get error on type of as: Type 'string | ConcreteComponent<{}, any, any, ComputedOptions, MethodOptions, {}, any>' is not assignable to type 'string | undefined'. I couldn't find an answer in Nuxt post.

@frasza
Copy link
Author

frasza commented Aug 3, 2024

Note: if I ignore the error, it actually works, just seems to be conflicting types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants