Skip to content

Commit 1ec9427

Browse files
committed
refactor(notification demos): replace Flex and Button components with a-flex and a-button
1 parent 7664827 commit 1ec9427

File tree

4 files changed

+42
-42
lines changed

4 files changed

+42
-42
lines changed

packages/docs/src/pages/components/notification/demo/close-tag.vue

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script setup lang="ts">
22
import { Notification as notification } from "@antdv-next/x";
3-
import { Button, Flex } from "antdv-next";
43
54
const describeInfo: Record<NotificationPermission, string> = {
65
denied: "通知权限已被拒绝,你需要在浏览器网站设置中手动重置通知权限。",
@@ -29,30 +28,30 @@ const openClick = () => {
2928
</script>
3029

3130
<template>
32-
<Flex vertical gap="middle">
31+
<a-flex vertical gap="middle">
3332
<span>{{ describeInfo[permission] }}</span>
34-
<Flex gap="middle">
35-
<Button
33+
<a-flex gap="middle">
34+
<a-button
3635
type="primary"
3736
:disabled="permission !== 'default'"
3837
@click="requestPermission()"
3938
>
4039
{{ permission === "default" ? "请求权限" : `通知权限:${permission}` }}
41-
</Button>
42-
<Button
40+
</a-button>
41+
<a-button
4342
type="primary"
4443
:disabled="permission !== 'granted'"
4544
@click="openClick"
4645
>
4746
发送通知
48-
</Button>
49-
<Button
47+
</a-button>
48+
<a-button
5049
danger
5150
:disabled="permission !== 'granted'"
5251
@click="close(['tag_task_completed'])"
5352
>
5453
按 Tag 关闭
55-
</Button>
56-
</Flex>
57-
</Flex>
54+
</a-button>
55+
</a-flex>
56+
</a-flex>
5857
</template>

packages/docs/src/pages/components/notification/demo/duration.vue

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script setup lang="ts">
22
import { Notification as notification } from "@antdv-next/x";
3-
import { Button, Flex } from "antdv-next";
43
54
const describeInfo: Record<NotificationPermission, string> = {
65
denied: "通知权限已被拒绝,你需要在浏览器网站设置中手动重置通知权限。",
@@ -29,23 +28,23 @@ const openClick = () => {
2928
</script>
3029

3130
<template>
32-
<Flex vertical gap="middle">
31+
<a-flex vertical gap="middle">
3332
<span>{{ describeInfo[permission] }}</span>
34-
<Flex gap="middle">
35-
<Button
33+
<a-flex gap="middle">
34+
<a-button
3635
type="primary"
3736
:disabled="permission !== 'default'"
3837
@click="requestPermission()"
3938
>
4039
{{ permission === "default" ? "请求权限" : `通知权限:${permission}` }}
41-
</Button>
42-
<Button
40+
</a-button>
41+
<a-button
4342
type="primary"
4443
:disabled="permission !== 'granted'"
4544
@click="openClick"
4645
>
4746
发送通知(自动关闭)
48-
</Button>
49-
</Flex>
50-
</Flex>
47+
</a-button>
48+
</a-flex>
49+
</a-flex>
5150
</template>

packages/docs/src/pages/components/notification/demo/hooks.vue

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import type { XNotificationOpenArgs } from "@antdv-next/x";
33
44
import { Notification as notification } from "@antdv-next/x";
5-
import { Button, Flex } from "antdv-next";
65
76
const describeInfo: Record<NotificationPermission, string> = {
87
denied: "通知权限已被拒绝,你需要在浏览器网站设置中手动重置通知权限。",
@@ -34,26 +33,26 @@ const [{ permission }, { open, requestPermission, close }] =
3433
</script>
3534

3635
<template>
37-
<Flex vertical gap="middle">
36+
<a-flex vertical gap="middle">
3837
<span>{{ describeInfo[permission] }}</span>
39-
<Flex gap="middle">
40-
<Button
38+
<a-flex gap="middle">
39+
<a-button
4140
type="primary"
4241
:disabled="permission !== 'default'"
4342
@click="requestPermission()"
4443
>
4544
{{ permission === "default" ? "请求权限" : `通知权限:${permission}` }}
46-
</Button>
47-
<Button
45+
</a-button>
46+
<a-button
4847
type="primary"
4948
:disabled="permission !== 'granted'"
5049
@click="open(openData)"
5150
>
5251
发送通知
53-
</Button>
54-
<Button danger :disabled="permission !== 'granted'" @click="close()">
52+
</a-button>
53+
<a-button danger :disabled="permission !== 'granted'" @click="close()">
5554
关闭所有
56-
</Button>
57-
</Flex>
58-
</Flex>
55+
</a-button>
56+
</a-flex>
57+
</a-flex>
5958
</template>

packages/docs/src/pages/components/notification/demo/static-method.vue

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script setup lang="ts">
22
import { Notification as notification } from "@antdv-next/x";
3-
import { Button, Flex } from "antdv-next";
43
54
const describeInfo: Record<NotificationPermission, string> = {
65
denied: "通知权限已被拒绝,你需要在浏览器网站设置中手动重置通知权限。",
@@ -43,22 +42,26 @@ const closeAll = () => {
4342
</script>
4443

4544
<template>
46-
<Flex vertical gap="middle">
45+
<a-flex vertical gap="middle">
4746
<span>{{ describeInfo[permission] }}</span>
48-
<Flex gap="middle">
49-
<Button
47+
<a-flex gap="middle">
48+
<a-button
5049
type="primary"
5150
:disabled="permission !== 'default'"
5251
@click="request"
5352
>
5453
{{ permission === "default" ? "请求权限" : `通知权限:${permission}` }}
55-
</Button>
56-
<Button type="primary" :disabled="permission !== 'granted'" @click="open">
54+
</a-button>
55+
<a-button
56+
type="primary"
57+
:disabled="permission !== 'granted'"
58+
@click="open"
59+
>
5760
发送通知
58-
</Button>
59-
<Button danger :disabled="permission !== 'granted'" @click="closeAll">
61+
</a-button>
62+
<a-button danger :disabled="permission !== 'granted'" @click="closeAll">
6063
关闭所有
61-
</Button>
62-
</Flex>
63-
</Flex>
64+
</a-button>
65+
</a-flex>
66+
</a-flex>
6467
</template>

0 commit comments

Comments
 (0)