J
J
Junior Development2020-10-16 12:53:04
JavaScript
Junior Development, 2020-10-16 12:53:04

How to make settings in the 'vue-smooth-scroll' nuxt.js plugin?

Installed the ' vue-smooth-scroll ' plugin in my project.

The plugin installed as written in the docs (Vue Plugins, ES6 plugins )
Created a file in the plugins folder, wrote in the file

import Vue from 'vue'
import vueSmoothScroll from 'vue-smooth-scroll'

Vue.use(vueSmoothScroll)


Tell me, is it possible to make settings in the plugin file so that each time you do not write them in
<a href="#div-id" v-smooth-scroll="{ duration: 1000, offset: -50 }">Anchor</a>


Something like that
import Vue from 'vue'
import vueSmoothScroll from 'vue-smooth-scroll'

Vue.use(vueSmoothScroll, {
    duration: 1000, 
    offset: -50 
})

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Mikhailov, 2020-10-16
@jun_dev

Why not a new version ?
In the new version, everything is done the way you want

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question