# إشعار Notification
إشعارات على شكل بطاقة من الزاوية العلوية اليمنى (يمكن ضبطها على الزوايا الأربع)، تناسب الردود الطويلة من نوع عقد تدفق العمل.
تنبيه إشعار
<template>
<div class="demo-col">
<div class="demo-row" style="gap: 12px; flex-wrap: wrap">
<LhButton @click="show('info')">معلومة</LhButton>
<LhButton type="primary" @click="show('success')">نجاح</LhButton>
<LhButton type="warning" @click="show('warning')">تحذير</LhButton>
<LhButton type="danger" @click="show('danger')">خطر</LhButton>
<LhButton @click="showClickable">بطاقة قابلة للنقر</LhButton>
<LhButton @click="closeAll">إغلاق الكل</LhButton>
</div>
<p class="demo-note">LhNotification.success({ title, content })؛ وبتمرير onClick تصبح البطاقة قابلة للنقر.</p>
</div>
</template>
<script>
export default {
methods: {
show(type) {
LhNotification[type]({
title: type + ' إشعار',
content: 'تم تحديث عقدة تدفق عمل رقمنة لوحة "رحلة بين الجبال والجدول".',
showClose: true,
})
},
showClickable() {
LhNotification.info({
title: 'جرّب النقر عليّ',
content: 'عند تمرير onClick تصبح البطاقة بأكملها قابلة للنقر.',
onClick() {
LhMessage.success('تم النقر على البطاقة')
},
})
},
closeAll() {
LhNotification.closeAll()
},
},
}
</script>
# واجهة الخدمة
LhNotification.success({ title: 'اكتمل الجمع', content: 'تمت أرشفة 120 لوحة' })
// info / success / warning / danger، والمعامل الثاني هو options
LhNotification.info({ title: 'انقر هنا', content: '...', onClick: () => {} })
LhNotification.closeAll()
# Notification Props
| خاصية | الوصف | النوع | الافتراضي |
|---|---|---|---|
| type | النوع | 'info' \| 'success' \| 'warning' \| 'danger' | 'info' |
| title | العنوان | string | — |
| content | النص الرئيسي | string | — |
| showClose | هل يُظهر زر الإغلاق | boolean | false |
| closeLabel | اسم إمكانية الوصول لزر الإغلاق (يُؤخَذ من حزمة اللغة notification.close عند غيابه) | string | — |
| onClick | عند تمريره تصبح البطاقة قابلة للنقر | () => void | — |
| sx | خصائص تخطيط سريعة عبر sx | — | — |
تلميح
يُضبط موضع ظهور الإشعارات (position: top-right / top-left / bottom-right / bottom-left) في خيارات openNotification، والافتراضي هو الزاوية العلوية اليمنى.
Copyright © 2024-2026 FengMo WenXue