Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(comp:tour): supports
targetDisabled
(#1869)
- Loading branch information
Showing
7 changed files
with
110 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
order: 0 | ||
title: | ||
zh: 禁用目标区域 | ||
en: Target disabled | ||
--- | ||
|
||
## zh | ||
|
||
通过 `targetDisabled` 或者 `step.targetDisabled` 禁用目标区域 | ||
|
||
## en | ||
|
||
Disable target operation via ``targetDisabled` or `step.targetDisabled`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<template> | ||
<div> | ||
<IxButton @click="beginTour">Begin</IxButton> | ||
<IxDivider /> | ||
<IxSpace> | ||
<div ref="firstBtnRef"> | ||
<IxButton>Step1</IxButton> | ||
</div> | ||
<div ref="secondBtnRef"> | ||
<IxButton>Step2</IxButton> | ||
</div> | ||
<div ref="thirdBtnRef"> | ||
<IxButton>Step3</IxButton> | ||
</div> | ||
</IxSpace> | ||
</div> | ||
<IxTour v-model:visible="tourVisible" :steps="steps" :onClose="onClose" :onFinish="onFinish" targetDisabled></IxTour> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import type { TourStep } from '@idux/components/tour' | ||
import { ref } from 'vue' | ||
const tourVisible = ref(false) | ||
const beginTour = () => (tourVisible.value = true) | ||
const firstBtnRef = ref<HTMLElement>() | ||
const secondBtnRef = ref<HTMLElement>() | ||
const thirdBtnRef = ref<HTMLElement>() | ||
const steps: TourStep[] = [ | ||
{ | ||
title: 'Step1', | ||
description: 'this is description...', | ||
target: () => firstBtnRef.value, | ||
}, | ||
{ | ||
title: 'Step2', | ||
description: 'this is description...', | ||
target: () => secondBtnRef.value, | ||
}, | ||
{ | ||
title: 'Step3', | ||
description: 'this is description...', | ||
target: () => thirdBtnRef.value, | ||
}, | ||
] | ||
const onClose = () => { | ||
console.log('onClose') | ||
} | ||
const onFinish = () => { | ||
console.log('onFinish') | ||
} | ||
</script> | ||
|
||
<style scoped lang="less"></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters