|
| 1 | +<template> |
| 2 | + <divdata-notificationclass="bx--toast-notification":class="dynamicClass"role="alert"> |
| 3 | + <divclass="bx--toast-notification__details"> |
| 4 | + <h3class="bx--toast-notification__title">{{title}}</h3> |
| 5 | + <pclass="bx--toast-notification__subtitle">{{subtitle}}</p> |
| 6 | + <pclass="bx--toast-notification__caption">{{caption}}</p> |
| 7 | + </div> |
| 8 | + <buttondata-notification-btnclass="bx--toast-notification__close-button"type="button"> |
| 9 | + <svgclass="bx--toast-notification__icon"aria-label="close"width="10"height="10"viewBox="0 0 10 10"fill-rule="evenodd"> |
| 10 | + <pathd="M9.8 8.6L8.4 10 5 6.4 1.4 10 0 8.6 3.6 5 .1 1.4 1.5 0 5 3.6 8.6 0 10 1.4 6.4 5z"></path> |
| 11 | + </svg> |
| 12 | + </button> |
| 13 | +</div> |
| 14 | + |
| 15 | +</template> |
| 16 | + |
| 17 | +<script> |
| 18 | +exportdefault { |
| 19 | + name:'ca-notification-toast', |
| 20 | + props: { |
| 21 | + error: { |
| 22 | + type:Boolean, |
| 23 | + default:false |
| 24 | + }, |
| 25 | + info: { |
| 26 | + type:Boolean, |
| 27 | + default:false |
| 28 | + }, |
| 29 | + success: { |
| 30 | + type:Boolean, |
| 31 | + default:false |
| 32 | + }, |
| 33 | + warning: { |
| 34 | + type:Boolean, |
| 35 | + default:false |
| 36 | + }, |
| 37 | + title: { |
| 38 | + type:String, |
| 39 | + default:'' |
| 40 | + }, |
| 41 | + subtitle: { |
| 42 | + type:String, |
| 43 | + default:'' |
| 44 | + }, |
| 45 | + caption: { |
| 46 | + type:String, |
| 47 | + default:'' |
| 48 | + } |
| 49 | + }, |
| 50 | + computed: { |
| 51 | +dynamicClass () { |
| 52 | +return { |
| 53 | +'bx--toast-notification--error':this.error, |
| 54 | +'bx--toast-notification--info':this.info, |
| 55 | +'bx--toast-notification--success':this.success, |
| 56 | +'bx--toast-notification--warning':this.warning, |
| 57 | + } |
| 58 | + } |
| 59 | + } |
| 60 | + }; |
| 61 | +</script> |
| 62 | + |
| 63 | +<style></style> |