Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

fix: typescript for script setup incorrect. #553

@TrungRueta

Description

@TrungRueta

🐛 The bug
As from version 0.28 we start support script setup. Test files for now only on javascript. In Typescript i found that ref variables not converted to value on template:

image

Our document still not mention about typescript type, since we use unplugin-vue2-script-setup for script setup, i try to add unplugin-vue2-script-setup/types to tsconfig.json. Result is ref variable turn to correct, but now all custom component turn to any.

image

image

This issue go away if use @vue/composition-api with unplugin-vue2-script-setup. So i think issue come from our package somehow

🛠️ To reproduce
Steps to reproduce the behavior:

  1. create new nuxt project
  2. install @nuxtjs/composition-api
  3. write new custom component use script setup, like in screenshot
  4. see error about ref variable
  5. isntall unplugin-vue2-script-setup. add tsconfig.json
  6. create new Test component use script setup
  7. import Test component to main component
  8. see error when component inspected as ANY.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions