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

Infer Component Name from .vue filename #86

Open
Aaron-Pool opened this issue Dec 15, 2021 · 4 comments
Open

Infer Component Name from .vue filename #86

Aaron-Pool opened this issue Dec 15, 2021 · 4 comments

Comments

@Aaron-Pool
Copy link

I can't find it in the <script setup> docs at the moment, but I followed the script setup spec pretty closely, and I could have sworn that the name field of the component options is inferred from the name of the .vue file when script setup is used in Vue3. Can that functionality be added here? I've actually used patch-package to patch the transform to enable that functionality in my own dev environment, but I'd love to get it merged into the package proper, so that I don't have to maintain a patch file as I upgrade to different versions of this plugin.

I'd be happy to do the PR myself, if that would be helpful and if this was functionality you'd be ok with adding to the core plugin functionality.

@xiaoxiangmoe
Copy link
Collaborator

xiaoxiangmoe commented Dec 17, 2021

@Aaron-Pool Thank for your suggestion. But I think it would be better if this feature could be added in https://github.com/vuejs/vue-loader and https://github.com/underfin/vite-plugin-vue2

@xiaoxiangmoe
Copy link
Collaborator

Also , I found that vue 3 also does not have SFC automatic name field generation. Maybe it's better for us to raise this question on https://github.com/vuejs/vue-next first.

@Aaron-Pool
Copy link
Author

You're right. I went through the script setup spec, and I couldn't find it anywhere. So I guess I'm just thinking of a conversation that happened in the RFC and it never made it to the official spec.

@Aaron-Pool
Copy link
Author

@xiaoxiangmoe

Re-opening this request, as it is now the behavior of Vue 3 script setup: vuejs/core#4997

@Aaron-Pool Aaron-Pool reopened this May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants