Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

372
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda