车间能级提升-智能设备管理系统
朱桂飞
2025-01-09 3e8f7f239bedae0b4f04a1ac6bd443ba6298f73c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<script lang="ts" setup>
import { Page } from '@vben/common-ui';
 
import { type NotificationType } from 'naive-ui';
import { NButton, NCard, NSpace, useMessage, useNotification } from 'naive-ui';
 
const notification = useNotification();
 
const message = useMessage();
function error() {
  message.error('Once upon a time you dressed so fine');
}
 
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 loading() {
  message.loading(
    'If I were you, I will realize that I love you more than any other guy',
  );
}
 
function notify(type: NotificationType) {
  notification[type]({
    content: '说点啥呢',
    duration: 2500,
    keepAliveOnHover: true,
    meta: '想不出来',
  });
}
</script>
 
<template>
  <Page description="支持多语言,主题功能集成切换等" title="naive组件使用演示">
    <NCard class="mb-5" title="按钮">
      <NSpace>
        <NButton>Default</NButton>
        <NButton type="tertiary"> Tertiary </NButton>
        <NButton type="primary"> Primary </NButton>
        <NButton type="info"> Info </NButton>
        <NButton type="success"> Success </NButton>
        <NButton type="warning"> Warning </NButton>
        <NButton type="error"> Error </NButton>
      </NSpace>
    </NCard>
 
    <NCard class="mb-5" title="Message">
      <NSpace>
        <NButton type="error" @click="error"> 错误 </NButton>
        <NButton type="warning" @click="warning"> 警告 </NButton>
        <NButton type="success" @click="success"> 成功 </NButton>
        <NButton type="primary" @click="loading"> 加载中 </NButton>
      </NSpace>
    </NCard>
 
    <NCard class="mb-5" title="Notification">
      <NSpace>
        <NButton type="error" @click="notify('error')"> 错误 </NButton>
        <NButton type="warning" @click="notify('warning')"> 警告 </NButton>
        <NButton type="success" @click="notify('success')"> 成功 </NButton>
        <NButton type="primary" @click="notify('info')"> 加载中 </NButton>
      </NSpace>
    </NCard>
  </Page>
</template>