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

Typescript: accept Enum as plain object in template #35

Closed
TrungRueta opened this issue Sep 3, 2021 · 2 comments
Closed

Typescript: accept Enum as plain object in template #35

TrungRueta opened this issue Sep 3, 2021 · 2 comments

Comments

@TrungRueta
Copy link
Contributor

Hi!

version: plugin v0.5.6 - nuxt 2.15.8

When use typescript in project i usually use enum as safe way to store config values. With composition api setup function we can do like this without issue:

image
image

When use script setup , editor still accept write enum and pass to template, but in runtime it not actually foward enum to template :

image
image

can we update this part to accept enum as normal static plain object in template.

Thank you!

@Shinigami92
Copy link
Contributor

Is this supported by Vue 3?

@TrungRueta
Copy link
Contributor Author

@Shinigami92 Hi, i posted public repo here to demo use enum as plain object thought script setup on Vue v3

https://github.com/TrungRueta/vue3-test

this project created by vue-cli latest, with only vue 3 - typescript setup

check file component:
https://github.com/TrungRueta/vue3-test/blob/master/src/components/HelloWorld.vue

@antfu antfu closed this as completed in b54ac90 Sep 6, 2021
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