创建于2024-02-15更新于 2024-04-09
新手引导
TODO: 封装成通用方法
具体案例可参考 src\views\wxwork\member\WxworkBatchTagList.vue
导入
import intro from 'intro.js';
import 'intro.js/minified/introjs.min.css';使用
在需要引导的元素上增加 ID(如果有 Class 就直接用 Class 也行)
// 页面引导
function handleStart() {
intro()
.setOptions({
prevLabel:'上一步',
nextLabel: '下一步',
doneLabel: '完成',
steps: [
{
title: '使用引导',
intro: '本功能用于批量导入用户名单,并打上标签。',
},
{
title: '下载导入模板',
element: document.querySelector('#step1'),
intro: '按照要求填写表单',
}
],
})
.start();
}页头增加按钮
<PageWrapper title="批量打标签" contentBackground dense>
<template #tags>
<Icon icon="ant-design:alert-outlined" @click="handleStart" class="intro"></Icon>
</template>
</PageWrapper><style scoped lang="less">
.intro {
color: @primary-color;
}
</style>
全局元素获取
import { useDesign } from '/@/hooks/web/useDesign';
const { prefixVar } = useDesign('');在 element 中,使用以下方法获取元素
{
title: '下载导入模板',
element: document.querySelector(`.${prefixVar}-layout-header-trigger`)!,
intro: '按照要求填写表单',
}页面信息›
已优化否