当前位置:网站首页>Web页面用户分步操作引导插件driver.js
Web页面用户分步操作引导插件driver.js
2022-07-02 05:51:00 【想吃凤梨酥】
driver.js是一个网页端的用户操作分步引导操作,可以在整个页面上引导用户操作,用这种方式来引导用户在进入页面后的操作,以便于用户更快的熟悉系统功能!
安装
npm install driver.js
使用
在main.ts里引入并绑定
import {
createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 引入
import Driver from 'driver.js'
import 'driver.js/dist/driver.min.css'
const app = createApp(App)
// 绑定
app.config.globalProperties.$driver = new Driver({
doneBtnText: '完成', // Text on the final button
closeBtnText: '关闭', // Text on the close button for this step
stageBackground: '#fff', // Background color for the staged behind highlighted element
nextBtnText: '下一步', // Next button text for this step
prevBtnText: '上一步', // Previous button text for this step
})
app.use(store)
app.use(router)
app.mount('#app')
配置引导节点(新建文件driver.ts)
export default [
{
element: '#userInfo',
popover: {
title: '用户信息',
description: '显示用户名,退出,全屏操作,换肤操作',
position: 'left',
}
},
{
element: '#grid',
popover: {
title: '收缩,面包屑',
description: '点击开关导航栏,面包屑展示',
position: 'right',
}
},
{
element: '#tagGroup',
popover: {
title: 'tag标签',
description: '记录打开页面',
position: 'bottom',
}
},
{
element: '#mainInfo',
popover: {
title: '内容区',
description: '显示页面内容',
position: 'left',
}
},
{
element: '#nav',
popover: {
title: '导航区',
description: '导航功能展示',
position: 'right',
}
},
]
需要引导的页面中导入节点配置文件
<script lang="ts">
import {
Options, Vue } from "vue-class-component";
import driverStep from "@/utils/driver";
@Options({
components: {
},
mounted() {
this.$driver.defineSteps(driverStep);
this.$driver.start();
},
})
export default class HomeView extends Vue {
}
</script>
driver.ts里的id页面上都要有,json数据的顺序就是引导的顺序
边栏推荐
- Zzuli:1066 character classification statistics
- [whether PHP has soap extensions installed] a common problem for PHP to implement soap proxy: how to handle class' SoapClient 'not found in PHP
- centos8安裝mysql8.0.22教程
- 线程池概述
- PHP read file (read the specified line containing a string in the file)
- [technical notes-08]
- 1036 Boys vs Girls
- all3dp. All Arduino projects in com website (2022.7.1)
- Youth training camp -- database operation project
- Innovation never stops -- the innovation process of nvisual network visualization platform for Excel import
猜你喜欢
随机推荐
Oled12864 LCD screen
Test case
PHP 开发与测试 Webservice(SOAP)-Win
青训营--数据库实操项目
5g market trend in 2020
PHP array to XML
KMP idea and template code
Zzuli:1061 sequential output of digits
php内的addChild()、addAttribute()函数
Zzuli:1069 learn from classmate Z
centos8安装mysql8.0.22教程
Taskbar explicit / implicit toggle function
php继承(extends)
2022-2-14 learning xiangniuke project - Section 7 account setting
2022-2-15 learning xiangniuke project - Section 8 check login status
idea开发工具常用的插件合集汇总
mysql的约束总结
PHP read file (read JSON file, convert to array)
RGB infinite cube (advanced version)
PHP inner class name is the same as the inner class method name







![[golang syntax] be careful with the copy of slices](/img/5e/1c82c58940939b94d03377ebdc03e3.jpg)

![[PHP是否安装了 SOAP 扩]对于php实现soap代理的一个常见问题:Class ‘SoapClient‘ not found in PHP的处理方法](/img/25/73f11ab2711ed2cc9f20bc7f9116b6.png)