2024-09-29 00:38:17 +08:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref } from "vue";
|
|
|
|
|
import TutorialSteps from "/@/components/tutorial/tutorial-steps.vue";
|
2025-03-10 16:06:40 +08:00
|
|
|
|
2025-06-29 14:09:09 +08:00
|
|
|
defineOptions({
|
|
|
|
|
name: "TutorialModal",
|
|
|
|
|
});
|
|
|
|
|
|
2025-03-10 16:06:40 +08:00
|
|
|
const props = defineProps<{
|
|
|
|
|
showIcon?: boolean;
|
|
|
|
|
}>();
|
|
|
|
|
|
2024-09-29 00:38:17 +08:00
|
|
|
const openedRef = ref(false);
|
|
|
|
|
function open() {
|
|
|
|
|
openedRef.value = true;
|
|
|
|
|
}
|
2024-10-31 10:32:05 +08:00
|
|
|
const slots = defineSlots();
|
2024-09-29 00:38:17 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2024-10-31 10:32:05 +08:00
|
|
|
<div class="tutorial-button pointer" @click="open">
|
|
|
|
|
<template v-if="!slots.default">
|
2025-06-29 14:09:09 +08:00
|
|
|
<fs-icon v-if="showIcon === false" icon="ant-design:question-circle-outlined" class="mr-0.5"></fs-icon>
|
|
|
|
|
<div class="hidden md:block">{{ $t("tutorial.title") }}</div>
|
2024-10-31 10:32:05 +08:00
|
|
|
</template>
|
|
|
|
|
<slot></slot>
|
2024-09-29 00:38:17 +08:00
|
|
|
<a-modal v-model:open="openedRef" class="tutorial-modal" width="90%">
|
2025-06-29 14:09:09 +08:00
|
|
|
<template #title>{{ $t("tutorial.title") }}</template>
|
2024-09-29 00:38:17 +08:00
|
|
|
<tutorial-steps v-if="openedRef" />
|
|
|
|
|
<template #footer></template>
|
|
|
|
|
</a-modal>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style lang="less">
|
|
|
|
|
.tutorial-modal {
|
2024-09-29 14:57:20 +08:00
|
|
|
top: 50px;
|
2024-09-29 00:38:17 +08:00
|
|
|
.ant-modal-body {
|
2024-09-29 14:57:20 +08:00
|
|
|
height: 80vh;
|
2024-09-29 00:38:17 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|