vuejs / vetur

Vue tooling for VS Code.

Home Page:https://vuejs.github.io/vetur/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

highlight error when use typeof in v-if

wlchn opened this issue · comments

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform:
    Version: 1.76.2 (Universal)
    Commit: ee2b180d582a7f601fa6ecfdad8d9fd269ab1884
    Date: 2023-03-14T17:54:09.061Z
    Electron: 19.1.11
    Chromium: 102.0.5005.196
    Node.js: 16.14.2
    V8: 10.2.154.26-electron.0
    OS: Darwin x64 21.6.0
    Sandboxed: No

Problem

highlight error when use typeof in v-if

Reproducible Case

wrong case:
image

<template>
  <div>
    <div v-if="typeof foo === 'number'">demo text</div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      foo: '',
    }
  },
}
</script>

right cases:
image
image

Had the same issue, turns out, the guilty was Vue Syntax Highlight by rahul Kadyan (https://marketplace.visualstudio.com/items?itemName=znck.vue-language-features)