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

Nuxt 3: Variable X is declared but its value is never read.ts(6133) #1735

Closed
phillipmohr opened this issue Aug 19, 2022 · 2 comments
Closed
Labels
duplicate This issue or pull request already exists

Comments

@phillipmohr
Copy link

Hello,

I'm using Nuxt 3 + VS Code + Vue Language Features (Volar) + TypeScript Vue Plugin (Volar).
When I define variables within my script, Volar doesn't seem to recognize that I'm using those in my template.

Here is an Example. Menus.vue

<template>
    <AdminFormBuilder
        @isLoading="setIsLoading"
    >
        <template #form:before>
            <AdminCrudHeader
                :isLoading="isLoading"
            />
        </template>
    </AdminFormBuilder>
</template>


<script lang="ts" setup>
const isLoading = ref(false)
const setIsLoading = (value: boolean) => {
    isLoading.value = value
}
</script>

Hovering over setIsLoading tells me 'setIsLoading' is declared but its value is never read.ts(6133)

@johnsoncodehk
Copy link
Member

Duplicate of #1729

@johnsoncodehk johnsoncodehk marked this as a duplicate of #1729 Aug 27, 2022
@johnsoncodehk johnsoncodehk added the duplicate This issue or pull request already exists label Aug 27, 2022
@RSS1102
Copy link

RSS1102 commented Sep 1, 2022

I met this too in Nuxt3.
After I refer to 1168#.
do:

image

then:
(In nuxt3 methods that do not need to import "Vue")
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants