framework icon indicating copy to clipboard operation
framework copied to clipboard

fix(nuxt): allow auto-import component with same filename

Open danielroe opened this issue 3 years ago • 2 comments

🔗 Linked issue

resolves #7696

❓ Type of change

  • [ ] 📖 Documentation (updates to the documentation or readme)
  • [x] 🐞 Bug fix (a non-breaking change that fixes an issue)
  • [ ] 👌 Enhancement (improving an existing functionality like performance)
  • [ ] ✨ New feature (a non-breaking change that adds functionality)
  • [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Within a file named Foo/Bar.vue if it resolves <Bar />, Vue will pass a second param to resolveComponent, which our regexp didn't allow for. This PR allows resolving <Bar /> from auto-imports in this case. If <Bar /> doesn't exist, it will fall back to the Vue behaviour that allows use of recursive components in this way.

📝 Checklist

  • [x] I have linked an issue or discussion.
  • [ ] I have updated the documentation accordingly.

danielroe avatar Sep 21 '22 09:09 danielroe

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

codesandbox[bot] avatar Sep 21 '22 09:09 codesandbox[bot]

Deploy Preview for nuxt3-docs canceled.

Name Link
Latest commit 53be5b818c7371ea4109fe0f3d109313492ae37d
Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/63331bfa2a75750009943409

netlify[bot] avatar Sep 21 '22 09:09 netlify[bot]