J
J
Junior Development2021-03-01 10:41:14
JavaScript
Junior Development, 2021-03-01 10:41:14

How to connect a plugin/library in Vue Cli (vue3)?

I am using Vuecli.

I'm trying to connect this plugin https://www.npmjs.com/package/vue3-smooth-scroll?r... , I get a

warning :

[Vue warn]: Failed to resolve directive: smooth-scroll 
  at <App>

error:
Uncaught TypeError: Cannot read property 'created' of undefined


Tell me how to connect?
in the component
<template>
  <section>
    
    <div>
      <h1>Title</h1>
      <a href='#form' v-smooth-scroll role='button'>Down</a>
    </div>

    <form id='form'>
      <h3>Form</h3>
    </form>

    </section>
</template>

<script>

export default {
  name: 'App',
  components: {},
  data() {
    return {}
  },
}
</script>


in main.js
import { createApp } from 'vue'

import App from './App.vue'

createApp(App).mount('#app')


or in vue.config.js?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question