47 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Vue
		
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Vue
		
	
	
| <docs>
 | |
| ---
 | |
| order: 2
 | |
| title:
 | |
|   zh-CN: å¸Ļæåžæ įéįĨæéæĄ
 | |
|   en-US: Notification with icon
 | |
| ---
 | |
| 
 | |
| ## zh-CN
 | |
| 
 | |
| éįĨæéæĄåˇĻäž§æåžæ ã
 | |
| 
 | |
| ## en-US
 | |
| 
 | |
| A notification box with a icon at the left side.
 | |
| 
 | |
| </docs>
 | |
| 
 | |
| <template>
 | |
|   <div>
 | |
|     <a-button @click="() => openNotificationWithIcon('success')">Success</a-button>
 | |
|     <a-button @click="() => openNotificationWithIcon('info')">Info</a-button>
 | |
|     <a-button @click="() => openNotificationWithIcon('warning')">Warning</a-button>
 | |
|     <a-button @click="() => openNotificationWithIcon('error')">Error</a-button>
 | |
|   </div>
 | |
| </template>
 | |
| <script lang="ts">
 | |
| import { notification } from 'ant-design-vue';
 | |
| import { defineComponent } from 'vue';
 | |
| 
 | |
| export default defineComponent({
 | |
|   setup() {
 | |
|     const openNotificationWithIcon = (type: string) => {
 | |
|       notification[type]({
 | |
|         message: 'Notification Title',
 | |
|         description:
 | |
|           'This is the content of the notification. This is the content of the notification. This is the content of the notification.',
 | |
|       });
 | |
|     };
 | |
| 
 | |
|     return {
 | |
|       openNotificationWithIcon,
 | |
|     };
 | |
|   },
 | |
| });
 | |
| </script>
 |