1.引入依赖
yarn add driver.js -S
或者 npm install dirver.js -S
-
在utils文件夹下新建一个driver.js用于存提示信息
image.png
-
在src下新建一个global文件夹用于存放全局函数和全局变量
image.png
import Driver from 'driver.js'
import 'driver.js/dist/driver.min.css'
import Vue from 'vue'
Vue.prototype.$driver = new Driver()
exports.install = function(Vue, options) {
Vue.prototype.text1 = function() {
alert('执行成功1')
}
}
4.在main.js中挂载到vue上

5.使用:在layout文件里使用



this.$driver.defineSteps(driverItem)
this.$driver.start()
在mouted函数调后端接口去判断当前用户是否是第一次登录,如果是调引导页函数,否则不调
网友评论