-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(comp:modal): add
spin
support for modal (#1974)
- Loading branch information
Showing
12 changed files
with
181 additions
and
32 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
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 @@ | ||
--- | ||
title: | ||
zh: 加载中状态 | ||
en: Loading status | ||
order: 3 | ||
--- | ||
|
||
## zh | ||
|
||
加载中状态。 | ||
|
||
## en | ||
|
||
Loading status. |
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,43 @@ | ||
<template> | ||
<IxSpace vertical> | ||
<IxButton mode="primary" @click="showModal">Open Modal with async logic</IxButton> | ||
<IxSpace> | ||
<span>spinWithFullModal: </span> | ||
<IxSwitch v-model:checked="spinWithFullModal"></IxSwitch> | ||
</IxSpace> | ||
</IxSpace> | ||
|
||
<IxModal | ||
v-model:visible="visible" | ||
:spin="spin" | ||
:spinWithFullModal="spinWithFullModal" | ||
header="Loading status" | ||
:closable="!spin" | ||
:mask-closable="!spin" | ||
title="This is title" | ||
type="confirm" | ||
@ok="onOk" | ||
> | ||
<p>Some contents...</p> | ||
</IxModal> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
const visible = ref(false) | ||
const spin = ref(false) | ||
const spinWithFullModal = ref(false) | ||
const onOk = () => | ||
new Promise(resolve => { | ||
spin.value = true | ||
setTimeout(() => { | ||
resolve(true) | ||
spin.value = false | ||
}, 3000) | ||
}) | ||
const showModal = () => { | ||
visible.value = true | ||
} | ||
</script> |
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