Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Nuxt 4 module author: Component slot prop types missing.

Đang mở
#701 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
nuxtjs, typescript
Lĩnh vực
build-system, tooling

Hướng nghiên cứu

Bắt đầu với bản tái hiện được liên kết và chạy npm run dev:prepare && npm run prepack. Kiểm tra các tệp được tạo dist/runtime/components/NavigationComponent.d.vue.ts và NavigationComponent.vue.d.ts, so sánh prop data của slot content với NavigationItem[] từ NavigationComponent.vue. Được xem là hoàn tất khi các khai báo được tạo giữ nguyên kiểu của prop slot thay vì phát ra any.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Environment
  • Operating System: Darwin
  • Node Version: v22.14.0
  • Nuxt Version: 4.2.1
  • CLI Version: 3.30.0
  • Nitro Version: 2.12.9
  • Package Manager: [email protected]
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -
Reproduction

Public github repo:

https://github.com/juanpscotto/nuxt-4-module-starter-types-issue

Stackblitz:

https://stackblitz.com/github/juanpscotto/nuxt-4-module-starter-types-issue?file=src%2Fruntime%2Fcomponents%2FNavigationComponent.vue%3AL29

In stackblitz wait until the project is setup. Or run this command npm run dev:prepare && npm run prepack if running locally.

Once it has finished check the dist/runtime/components/NavigationComponent.d.vue.ts file, the slot type is missing.

Additional context

There is one component NavigationComponent that has a named slot content with a data prop array of type NavigationItem[]. That type is carried over as any in both NavigationComponent.d.vue.ts and NavigationComponent.vue.d.ts files

NavigationComponent.vue:

Image

NavigationComponent.d.vue.ts

Image
Describe the bug

The slot props types are not being carried over to the generated .ts files of the .vue components. I expect the type of the data props to be recognized.

Image
Logs

Ngôn ngữ chính
TypeScript
Star
277
Fork
36
Merge trung bình
2 giờ 46 phút
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nuxt/module-builder

Tất cả issue của nuxt/module-builder

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.