2021-06-17 21:43:53 +08:00
|
|
|
<template>
|
2021-06-17 21:43:53 +08:00
|
|
|
<PageWrapper title="引导页" content="用于给用户的指引操作">
|
2021-06-17 21:43:53 +08:00
|
|
|
<a-button type="primary" @click="handleStart">开始</a-button>
|
|
|
|
|
</PageWrapper>
|
|
|
|
|
</template>
|
2023-11-18 11:43:18 +08:00
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { PageWrapper } from '@/components/Page';
|
|
|
|
|
import { useDesign } from '@/hooks/web/useDesign';
|
2023-10-15 11:34:13 +08:00
|
|
|
import { driver } from 'driver.js';
|
|
|
|
|
import 'driver.js/dist/driver.css';
|
2021-06-17 21:43:53 +08:00
|
|
|
|
2023-11-18 11:43:18 +08:00
|
|
|
const { prefixVar } = useDesign('');
|
2021-06-17 21:43:53 +08:00
|
|
|
|
2023-11-18 11:43:18 +08:00
|
|
|
function handleStart() {
|
|
|
|
|
driver({
|
|
|
|
|
showProgress: true,
|
|
|
|
|
steps: [
|
|
|
|
|
{
|
|
|
|
|
popover: {
|
|
|
|
|
title: 'Welcome',
|
|
|
|
|
description: 'Hello World! 👋',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
element: `.${prefixVar}-layout-header-trigger`,
|
|
|
|
|
popover: {
|
|
|
|
|
title: 'Collapse Button',
|
|
|
|
|
description: 'This is the menu collapse button.',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
element: `.${prefixVar}-layout-header-action`,
|
|
|
|
|
popover: {
|
|
|
|
|
title: 'User Action',
|
|
|
|
|
description: 'This is the user function area.',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
}).drive();
|
|
|
|
|
}
|
2021-06-17 21:43:53 +08:00
|
|
|
</script>
|