티스토리 뷰

왜!!!!!!!!!!!!!!!!!!! ts에서는 defineComponent 써야된대서 그것도 해줬잖아!!! 왜 그래 대체 왜!!!!!!!!!!

export에 빨간줄 왜 안 없어지는데!!!!!!!!!!

// App.vue

<script setup lang="ts">
import { defineComponent } from 'vue';
import Home from './components/Home.vue';

export default defineComponent({
  name: 'app',
  components: {
    Home,
  },
});
</script>

<template>
  <div id="main">
    <h1>Welcome to Vue Playground!</h1>
    <Home></Home>
  </div>
</template>

A default export must be at the top level of a file or module declaration.ts(1258)

 


이유

알수없다.... 그냥 열받아서 setup을 지웠더니 사라졌다... 지금은 vue 초보니까... 나중에 다시 알아보겠다... 🥲

* setup에 마우스를 올리면 나오는 내용

Each *.vue file can contain at most one <script setup> block at a time (excluding normal <script>).

The script is pre-processed and used as the component's setup() function, which means it will be executed for each instance of the component. Top-level bindings in <script setup> are automatically exposed to the template. For more details, see dedicated documentation on <script setup>.
728x90
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
글 보관함