Vs code doesn't show error when I comment out import component statement in Vue SFC

Viewed 16

I was coding a Vue example scapfoled usingnpm init vue@latest in typescript using vscode,when I comment out the import statement, vs code doesn't show any error or warning, and lead to runtime error, I was expecting vs code show a static type checking, but not error shown.

<script lang="ts" setup>
import { ref } from "vue";
// import TodoItem from "./components/TodoItem.vue";

const groceryList = ref([
  {
    id: 0,
    text: "Vegetables",
  },
  {
    id: 1,
    text: "Cheese",
  },
  {
    id: 2,
    text: "Whatever elese human are supposed to eat",
  },
]);
</script>


<template>
  <ol>
    <TodoItem
      v-for="item in groceryList"
      :key="item.id"
      :todo="item"
    ></TodoItem>
  </ol>
</template>

<style></style>

Please help me

0 Answers
Related