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

373
Visualizações
Failed to resolve directive: scroll-to Vue-scrollto

I am making a web application with Vue js(i am a newbie on vue js), specifically Vue 2.x. I want to click in an element of a menu, and then scroll to the that element. I have thought to use this tool https://vue-scrollto.netlify.app/examples/ as it is exactly what i want to do.

The problem is that when I repeat the same the code as in the examples, I receive the error "[Vue warn]: Failed to resolve directive: scroll-to". Here is my code:

<div :class="{subelementos: isOpenAndroid}">
        <div class="subelementos2">
          <p v-scroll-to="'#prueba'" class="subelementos3" @click="menuClick('android')">Principios</p>

        </div>
</div>

And then in another component:

<div id="prueba">
      <p>TEXTEXT</p>
</div>

I don't know if someone is familiar with this tool. I think i am missing something important.

PS: Maybe is a stupid question(sorry about that) but, do you think is mandatory to use Nuxtjs? On the official page of the tool it is mentioned, but I think is optional https://vue-scrollto.netlify.app/docs/#nuxt-js.

----EDIT----

The HTML, CSS and JS are in the same file, specifically on a .vue file. I think that maybe I have to import an external library into my .vue file.

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

0

The error indicates that you haven't registered the directive.

The vue-scrollto docs describe how to setup the directive. The plugin automatically registers the directive under the hood, and you can install the plugin in your app's entry point with Vue.use():

// main.js
import Vue from 'vue'
import VueScrollTo from 'vue-scrollto'

Vue.use(VueScrollTo)

demo

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