-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(comp:tour): tour closable should be configurable (#1622)
- Loading branch information
Showing
10 changed files
with
105 additions
and
6 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
order: 1 | ||
title: | ||
zh: 可关闭配置 | ||
en: Closable config | ||
--- | ||
|
||
## zh | ||
|
||
通过 `closable` 配置是否可关闭。 | ||
|
||
## en | ||
|
||
Set tour closable by clicking close button via `closable` prop. |
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,64 @@ | ||
<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" | ||
:closable="false" | ||
:onClose="onClose" | ||
:onFinish="onFinish" | ||
></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, | ||
}, | ||
{ | ||
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
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