Intro.js 简介和用法

Intro.js的简介和用法

很多网站或者app, 第一次访问或者登陆的时候, 往往会看到好看友好的新手导航页面。如果这个功能我们自己来做, 首先, 需要有一个弹框, 其次, 获取DOM的位置来确定弹框的显示顺序, 然后要知道新手导航有几步,等等, 想做完美, 不是一件容易的事情。 然而, 我们可以借助intro.js实现。

引入和使用

参考:https://www.jianshu.com/p/3f475e8fe870

  1. 安装intro.js
npm install intro.js --save
  1. 安装vue-introjs
    该工具包是在introjs基础上开发的,故先要安装introjs
npm i vue-introjs
  1. 相关配置
// webpack.config.js
{
    
    
    plugins: [
        new webpack.ProvidePlugin({
    
    
            // other modules
            introJs: ['intro.js']
        })
    ]
}

猜你喜欢

转载自blog.csdn.net/weixin_35773751/article/details/122522084