2024-08-11 16:09:32 +08:00
|
|
|
<script lang="ts" setup>
|
2024-08-11 20:05:52 +08:00
|
|
|
import { Page } from '@vben/common-ui';
|
|
|
|
|
2024-08-11 16:09:32 +08:00
|
|
|
import { Button, Card, message, notification, Space } from 'ant-design-vue';
|
|
|
|
|
|
|
|
type NotificationType = 'error' | 'info' | 'success' | 'warning';
|
|
|
|
|
|
|
|
function info() {
|
|
|
|
message.info('How many roads must a man walk down');
|
|
|
|
}
|
|
|
|
|
|
|
|
function error() {
|
|
|
|
message.error({
|
|
|
|
content: 'Once upon a time you dressed so fine',
|
|
|
|
duration: 2500,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function warning() {
|
|
|
|
message.warning('How many roads must a man walk down');
|
|
|
|
}
|
|
|
|
function success() {
|
|
|
|
message.success('Cause you walked hand in hand With another man in my place');
|
|
|
|
}
|
|
|
|
|
|
|
|
function notify(type: NotificationType) {
|
|
|
|
notification[type]({
|
|
|
|
duration: 2500,
|
|
|
|
message: '说点啥呢',
|
|
|
|
type,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2024-08-11 20:05:52 +08:00
|
|
|
<Page
|
|
|
|
description="支持多语言,主题功能集成切换等"
|
|
|
|
title="Ant Design Vue组件使用演示"
|
|
|
|
>
|
2024-08-31 21:24:48 +08:00
|
|
|
<Card class="mb-5" title="按钮">
|
2024-08-11 20:05:52 +08:00
|
|
|
<Space>
|
|
|
|
<Button>Default</Button>
|
|
|
|
<Button type="primary"> Primary </Button>
|
|
|
|
<Button> Info </Button>
|
|
|
|
<Button danger> Error </Button>
|
|
|
|
</Space>
|
|
|
|
</Card>
|
|
|
|
<Card class="mb-5" title="Message">
|
|
|
|
<Space>
|
2024-08-11 16:09:32 +08:00
|
|
|
<Button @click="info"> 信息 </Button>
|
|
|
|
<Button danger @click="error"> 错误 </Button>
|
|
|
|
<Button @click="warning"> 警告 </Button>
|
|
|
|
<Button @click="success"> 成功 </Button>
|
2024-08-11 20:05:52 +08:00
|
|
|
</Space>
|
|
|
|
</Card>
|
2024-08-11 16:09:32 +08:00
|
|
|
|
2024-08-11 20:05:52 +08:00
|
|
|
<Card class="mb-5" title="Notification">
|
|
|
|
<Space>
|
2024-08-11 16:09:32 +08:00
|
|
|
<Button @click="notify('info')"> 信息 </Button>
|
|
|
|
<Button danger @click="notify('error')"> 错误 </Button>
|
|
|
|
<Button @click="notify('warning')"> 警告 </Button>
|
|
|
|
<Button @click="notify('success')"> 成功 </Button>
|
2024-08-11 20:05:52 +08:00
|
|
|
</Space>
|
|
|
|
</Card>
|
|
|
|
</Page>
|
2024-08-11 16:09:32 +08:00
|
|
|
</template>
|