johnsoncodehk / vue-tsc

vue-tsc --noEmit && vite build
https://www.npmjs.com/package/vue-tsc
MIT License
241 stars 6 forks source link

`const enum` for vue 3.2 is not supported #51

Closed lijialiang closed 3 years ago

lijialiang commented 3 years ago

vue-tsc v0.0.24

<template>
  <p v-if="fruit === Fruit.apple">
    apple
  </p>
</template>

<script lang="ts" setup>
enum Fruit {
  apple = 0,
  banana = 1
}

const fruit = 0
</script>
$ npx vue-tsc --noEmit 

// error
src/views/test.vue:2:22 - error TS2552: Cannot find name 'Fruit'. Did you mean 'fruit'?

2   <p v-if="fruit === Fruit.apple">
lijialiang commented 3 years ago

Upgrade version to v0.2.2 Solved :)