Skip to content

Commit ee69b9f

Browse files
authored
🔀 [doc/dialog] update dialog doc
* 📄 [doc/dialog] update dialog doc * 🚨 [dialog] fix code lint errors
1 parent 434cd3e commit ee69b9f

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<script setup lang="ts">
2+
import { useDialog } from 'shuimo-ui/index';
3+
4+
const { visible, showDialog } = useDialog();
5+
</script>
6+
7+
<template>
8+
<m-button @click="showDialog">点击这里</m-button>
9+
<m-dialog v-model:visible="visible">
10+
<div>
11+
<h1>这里是dialog</h1>
12+
</div>
13+
</m-dialog>
14+
</template>
15+
16+
<style scoped>
17+
18+
</style>

doc/pages/docs/components/message/dialog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616

1717
::: demo message/dialog/closingControl
1818

19+
### {{$t(\'双向绑定\')}}
20+
21+
::: demo message/dialog/modelValue
22+
1923
## API
2024

2125
::: api message/dialog

playground/src/lib/Message.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717
<h1>这里是dialog</h1>
1818
</div>
1919
</m-dialog>
20+
21+
<m-button @click="showDialog">点击这里打开</m-button>
22+
<m-dialog v-model:visible="visible">
23+
<div>
24+
<h1>这里是dialog</h1>
25+
</div>
26+
</m-dialog>
2027
</ComponentsWrap>
2128
<ComponentsWrap name="Drawer">
2229
<m-drawer>
@@ -72,6 +79,9 @@
7279
*/
7380
import { MConfirm, MMessage } from 'shuimo-ui/index';
7481
import ComponentsWrap from '../components/ComponentsWrap.vue';
82+
import { useDialog } from "shuimo-ui/index";
83+
84+
const { visible, showDialog, closeDialog } = useDialog();
7585
7686
const activeConfirm = async () => {
7787
const res = await MConfirm({ content: '测试' });

0 commit comments

Comments
 (0)