UNPKG

primevue

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/primevue.svg)](https://badge.fury.io/js/primevue) [![Discord Chat](https://img.shields.io/discord/55794023

40 lines (35 loc) 1.27 kB
import { openBlock, createBlock, renderSlot, createTextVNode, toDisplayString } from 'vue'; var script = { name: 'Badge', props: { value: null, severity: null, size: null }, computed: { containerClass() { return this.$slots.default ? 'p-overlay-badge': this.badgeClass; }, badgeClass() { return ['p-badge p-component', { 'p-badge-no-gutter': this.value && String(this.value).length === 1, 'p-badge-dot': !this.value && !this.$slots.default, 'p-badge-lg': this.size === 'large', 'p-badge-xl': this.size === 'xlarge', 'p-badge-info': this.severity === 'info', 'p-badge-success': this.severity === 'success', 'p-badge-warning': this.severity === 'warning', 'p-badge-danger': this.severity === 'danger' }]; } } }; function render(_ctx, _cache, $props, $setup, $data, $options) { return (openBlock(), createBlock("span", { class: $options.badgeClass }, [ renderSlot(_ctx.$slots, "default", {}, () => [ createTextVNode(toDisplayString($props.value), 1) ]) ], 2)) } script.render = render; export default script;