当前位置:网站首页>smoothscroll-polyfill插件的用法
smoothscroll-polyfill插件的用法
2022-07-26 19:29:00 【YingUser】
使用这个插件可以实现滑动的效果,具体步骤如下:
1、npm 下载
npm install smoothscroll-polyfill --save2、在main.js中全局引入
import smoothscroll from "smoothscroll-polyfill"
smoothscroll.polyfill();3、在当前页面使用就引入
import smoothscroll from 'smoothscroll-polyfill';
具体主代码如下:
//注释:这里的 order-lock 是需要跳到的那个标签的类名
this.timer = setTimeout(() => {
smoothscroll.polyfill();
document
.getElementsByClassName('order-lock')[0]
.scrollIntoView({ block: 'start', inline: 'center', behavior: 'smooth' });
}, 3000);边栏推荐
- Using questpdf operation to generate PDF is faster and more efficient!
- TableWidget
- Use request header authentication to test API interfaces that need authorization
- three.js 制作地球标注的两种方法
- DevSecOps,让速度和安全兼顾
- numpy.newaxis
- Introduction to component functions of blueprism process business object Chapter 3 of RPA
- 数组操作增,删,改,查
- STM32F103有源蜂鸣器驱动程序
- SQL injection
猜你喜欢

Array operations add, delete, modify, and query

How to build a super interface collaboration platform: count the six weapons of apifox

three.js 给地球加标签和弹窗

一维数组定义与使用

C asynchronous programming read this article is enough

用 QuestPDF操作生成PDF更快更高效!

regular expression

C#将PDF文件转成图片

go+mysql+redis+vue3简单聊室,第6弹:使用vue3和element-plus调用接口

UE5编辑器Slate快速入门【开篇】
随机推荐
Definition and use of one-dimensional array
贴合课标新方向 猿辅导打造特色新概念内容体系
Fasttunnel open source intranet penetration framework
[cache series] advantages, disadvantages and choices of several cache read-write schemes
svn使用碎碎念
This points to the simplest rule remember it
模拟身份验证
金融机构导图
LeetCode_回溯_中等_216.组合总和 III
Cookie和Session
Jincang database kingbasees SQL language reference manual (18. SQL statement: drop materialized view to drop synonym)
Week 6 Convolutional Neural Networks (CNNs)
Zabbix调用api检索方法
本机号码一键登录原理与应用(荣耀典藏版)
Student's t distribution
Parallel execution (II). Multiprocessing
金融机构盘点
C# 客户端程序调用外部程序的3种实现方法
谷歌的新编程语言被称为 Carbon
并行执行(二)、multiprocessing