当前位置:网站首页>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数据的顺序就是引导的顺序
边栏推荐
- Alibaba: open source and self-developed liquid cooling data center technology
- 【論文翻譯】GCNet: Non-local Networks Meet Squeeze-Excitation Networks and Beyond
- 文件包含漏洞(一)
- [technical notes-08]
- Lantern Festival gift - plant vs zombie game (realized by Matlab)
- Simply encapsulate JS and apply it
- Oled12864 LCD screen
- Sliding window on the learning road
- Gcnet: non - local Networks meet Squeeze excitation Networks and Beyond
- h5跳小程序
猜你喜欢
Installation du tutoriel MySQL 8.0.22 par centos8
all3dp.com网站中全部Arduino项目(2022.7.1)
【論文翻譯】GCNet: Non-local Networks Meet Squeeze-Excitation Networks and Beyond
文件包含漏洞(一)
Practice C language advanced address book design
Conglin environmental protection rushes to the scientific and Technological Innovation Board: it plans to raise 2billion yuan, with an annual profit of more than 200million yuan
Online music player app
软件测试答疑篇
centos8安裝mysql8.0.22教程
15 C language advanced dynamic memory management
随机推荐
【论文翻译】GCNet: Non-local Networks Meet Squeeze-Excitation Networks and Beyond
Generate QR code
Taskbar explicit / implicit toggle function
PHP parent
RNN recurrent neural network
460. LFU cache bidirectional linked list
Zzuli:1066 character classification statistics
all3dp. All Arduino projects in com website (2022.7.1)
Importation de studio visuel
PHP read file (read the specified line containing a string in the file)
死磕大屏UI,FineReport开发日记
Zzuli:1060 numbers in reverse order
Test case
VSCode paste image插件保存图片路径设置
Determine whether there is an element in the string type
Pytorch Chinese document
Zzuli:1064 encrypted characters
php按照指定字符,获取字符串中的部分值,并重组剩余字符串为新的数组
中小型项目手撸过滤器实现认证与授权
Zzuli:1062 greatest common divisor