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

setup option から script setup への変換をサポートしてほしい #3

Open
ushironoko opened this issue Dec 2, 2021 · 3 comments

Comments

@ushironoko
Copy link

ushironoko commented Dec 2, 2021

@vue/composition-api を用いているプロジェクトで script setup の対応は以下のプラグインで出来るが、書き直すのが面倒なので対応してほしい

https://github.com/antfu/unplugin-vue2-script-setup

@nathanchase
Copy link

Would love to see this updated to be able to output <script setup>!

@fazulk
Copy link

fazulk commented Apr 6, 2023

I forked it and made it generate for script setup here: https://github.com/fazulk/vue-composition-converter

Although removed the compatibility with vuex. (now compatible with pinia)

@nathanchase
Copy link

I forked it and made it generate for script setup here: https://github.com/fazulk/vue-composition-converter

Although removed the compatibility with vuex. (now compatible with pinia)

Nicely done! Only issue I saw was if you have a template ref like:
const address = this.$refs.autocomplete.value;
it converts it to
const address = NEW_REF.autocomplete.value;
rather than creating a null reference like:
const autocomplete = ref(null);
and just using autocomplete.value.

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

3 participants