LoginSignup
0
0

More than 5 years have passed since last update.

スムーススクロール

Posted at

スムーススクロール

$ yarn add vue-smoothscroll

code:

...
import VueSmoothScroll from 'vue-smoothscroll'

Vue.use(VueSmoothScroll)
...

  methods:{
      ...
      scrollTo(id){
          this.$SmoothScroll(document.getElementById(id), 800);
      }
      ...
  }

template:

<input
  v-model="agreed"
  @change="scrollTo('scroll-submit')"
  type="checkbox" class="checkbox" name="agreed" />  

...
  <a name="submit" id="scroll-submit" ></a>
  <input type="submit"...>

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0