スムーススクロール
$ 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"...>