Home >Web Front-end >JS Tutorial >How to implement simulated anchor points in vue2.0
This time I will bring you how to implement simulation in vue2.0anchor point, what are the notes for implementing simulation anchor point in vue2.0, the following is a practical case , let’s take a look.
Solution:
<a href="javascript:void(0)" rel="external nofollow" @click="goAnchor('#anchor')"> 灰啊灰啊我的骄傲放纵</a>rrree
17. 9. 20 Update: The above has a BUG in FireFox, the fix is as follows:
methods: { goAnchor(selector) { var anchor = this.$el.querySelector(selector) document.body.scrollTop = anchor.offsetTop } }
I believe you have mastered it after reading the case in this article Method, for more exciting information, please pay attention to other related articles on the php Chinese website!
Recommended reading:
How to use sass configuration in vue project
How to use the on-change attribute in IView
The above is the detailed content of How to implement simulated anchor points in vue2.0. For more information, please follow other related articles on the PHP Chinese website!