Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

169
Visualizações
Error: 'HelloWorld' is defined but never used

App.vue file

<template lang="pug">
div
  hello-world
</template>
<script setup lang="ts">
import HelloWorld from "./components/HelloWorld.vue";
</script>

HelloWorld.vue file

<template lang="pug">
div
  h1 {{ msg }}
</template>

<script setup lang="ts">
import { ref } from "vue";

const msg = ref<string>("Hello World!!!");
</script>

What is the issue and how to fix it? Getting this issue when using typescript, composition API, and pug templating together in vue3. And the concern is how to import a component using composition API and use that in pug template?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I'm pretty sure the issue comes from preinstalling typescript. Removing typescript as the script language should do the trick then:

<script setup>

instead of

<script setup lang="ts">

If you don't want to remove it then try to figure out how typescript-components need to look different from plain js ones. Sorry I don't know much about Typescript, all I know is that it changes how the components work because they rely more on Typescript now instead of javascript. But I would guess that there's information on the vue 3 documentation about working with typescript.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda