1,driver.js 新用户引导
https://kamranahmed.info/driver.js/#single-element-no-popover
模型大致如下图:
在这里插入图片描述
2,代码如下:

import Driver from 'driver.js' // import driver.js
import 'driver.js/dist/driver.min.css' // import driver.js css
import steps from './defineSteps'
   mounted() {
    this.driver = new Driver({
    //此处为api
      animate: false,
      opacity: 0.70,
      allowClose: false, 
      doneBtnText: '',
      closeBtnText: '',
      nextBtnText: '',
      prevBtnText: '',  
      
  onReset: (Element)=>{
		//这里写逻辑回调
      }, 
    });
  setTimeout(() => {
  //添加延时器为了操作dom
    this.guide();
     },400)
  },
  methods: {
    guide() {
      this.driver.defineSteps(steps)
      this.driver.start()
    },
Logo

前往低代码交流专区

更多推荐