Refactor
parent
4108ff7e8d
commit
28053d5ee8
|
@ -3,10 +3,10 @@
|
||||||
<div v-show="visible" :class="cx('root')" role="alert" aria-live="assertive" aria-atomic="true" v-bind="ptm('root')">
|
<div v-show="visible" :class="cx('root')" role="alert" aria-live="assertive" aria-atomic="true" v-bind="ptm('root')">
|
||||||
<slot v-if="$slots.container" name="container" :closeCallback="close"></slot>
|
<slot v-if="$slots.container" name="container" :closeCallback="close"></slot>
|
||||||
<div v-else :class="cx('content')" v-bind="ptm('content')">
|
<div v-else :class="cx('content')" v-bind="ptm('content')">
|
||||||
<slot name="icon" class="p-message-icon">
|
<slot name="icon" :class="cx('icon')">
|
||||||
<component :is="icon ? 'span' : null" :class="[cx('icon'), icon]" v-bind="ptm('icon')"></component>
|
<component :is="icon ? 'span' : null" :class="[cx('icon'), icon]" v-bind="ptm('icon')"></component>
|
||||||
</slot>
|
</slot>
|
||||||
<div v-if="$slots.default" class="p-message-text" :class="cx('text')" v-bind="ptm('text')">
|
<div v-if="$slots.default" :class="cx('text')" v-bind="ptm('text')">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
<button v-if="closable" v-ripple :class="cx('closeButton')" :aria-label="closeAriaLabel" type="button" @click="close($event)" v-bind="{ ...closeButtonProps, ...ptm('closeButton') }">
|
<button v-if="closable" v-ripple :class="cx('closeButton')" :aria-label="closeAriaLabel" type="button" @click="close($event)" v-bind="{ ...closeButtonProps, ...ptm('closeButton') }">
|
||||||
|
@ -21,11 +21,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CheckIcon from '@primevue/icons/check';
|
|
||||||
import ExclamationTriangleIcon from '@primevue/icons/exclamationtriangle';
|
|
||||||
import InfoCircleIcon from '@primevue/icons/infocircle';
|
|
||||||
import TimesIcon from '@primevue/icons/times';
|
import TimesIcon from '@primevue/icons/times';
|
||||||
import TimesCircleIcon from '@primevue/icons/timescircle';
|
|
||||||
import Ripple from 'primevue/ripple';
|
import Ripple from 'primevue/ripple';
|
||||||
import BaseMessage from './BaseMessage.vue';
|
import BaseMessage from './BaseMessage.vue';
|
||||||
|
|
||||||
|
@ -55,14 +51,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
iconComponent() {
|
|
||||||
return {
|
|
||||||
info: InfoCircleIcon,
|
|
||||||
success: CheckIcon,
|
|
||||||
warn: ExclamationTriangleIcon,
|
|
||||||
error: TimesCircleIcon
|
|
||||||
}[this.severity];
|
|
||||||
},
|
|
||||||
closeAriaLabel() {
|
closeAriaLabel() {
|
||||||
return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : undefined;
|
return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : undefined;
|
||||||
}
|
}
|
||||||
|
@ -71,11 +59,7 @@ export default {
|
||||||
ripple: Ripple
|
ripple: Ripple
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
TimesIcon,
|
TimesIcon
|
||||||
InfoCircleIcon,
|
|
||||||
CheckIcon,
|
|
||||||
ExclamationTriangleIcon,
|
|
||||||
TimesCircleIcon
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue