当前位置:网站首页>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数据的顺序就是引导的顺序
边栏推荐
- 1036 Boys vs Girls
- Pytorch Chinese document
- 460. LFU 缓存 双向链表
- php内类名称与类内方法名相同
- Installation du tutoriel MySQL 8.0.22 par centos8
- PHP read file (read the specified line containing a string in the file)
- Zzuli: maximum Convention and minimum common multiple
- [PHP是否安装了 SOAP 扩]对于php实现soap代理的一个常见问题:Class ‘SoapClient‘ not found in PHP的处理方法
- Get the details of the next largest number
- ThreadLocal memory leak
猜你喜欢

Basic use of form

Alibaba: open source and self-developed liquid cooling data center technology

Brew install * failed, solution

Record sentry's path of stepping on the pit

Minimum value ruler method for the length of continuous subsequences whose sum is not less than s

KMP idea and template code
![[technical notes-08]](/img/52/0aff21b01ba7adbfcdb597d1aa85f9.png)
[technical notes-08]

Lingyunguang rushes to the scientific innovation board: the annual accounts receivable reaches 800million. Dachen and Xiaomi are shareholders

Stick to the big screen UI, finereport development diary
![[personal test] copy and paste code between VirtualBox virtual machine and local](/img/ce/eaf0bd9eff6551d450964da72e0b63.jpg)
[personal test] copy and paste code between VirtualBox virtual machine and local
随机推荐
Zzuli:1065 count the number of numeric characters
2022-2-14 learning xiangniuke project - Section 7 account setting
With an amount of $50billion, amd completed the acquisition of Xilinx
记录sentry的踩坑之路
Reflection of the soul of the frame (important knowledge)
Youth training camp -- database operation project
c语言中的几个关键字
Basic use of form
Matplotlib double Y axis + adjust legend position
1036 Boys vs Girls
mysql的约束总结
VSCode paste image插件保存图片路径设置
Vite打包后的dist不能直接在浏览器打开吗
Pytorch Basics
ThreadLocal memory leak
Online music player app
Technologists talk about open source: This is not just using love to generate electricity
php内类名称与类内方法名相同
《CGNF: CONDITIONAL GRAPH NEURAL FIELDS》阅读笔记
Importation de studio visuel