mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Fixed #4505 - V-Tooltip, TailwindCSS: Styling not working when using pinia store
This commit is contained in:
parent
cde6e2b2d1
commit
5ff7eb8e4c
4 changed files with 31 additions and 36 deletions
|
@ -5,11 +5,9 @@ const BadgeDirective = BaseBadgeDirective.extend('badge', {
|
|||
mounted(el, binding) {
|
||||
const id = UniqueComponentId() + '_badge';
|
||||
|
||||
el.unstyled = binding.instance.$primevue?.config?.unstyled || binding.value?.unstyled || false;
|
||||
|
||||
const badge = DomHandler.createElement('span', {
|
||||
id,
|
||||
class: !el.unstyled && this.cx('root'),
|
||||
class: !this.isUnstyled() && this.cx('root'),
|
||||
'p-bind': this.ptm('root', {
|
||||
context: {
|
||||
...binding.modifiers,
|
||||
|
@ -22,7 +20,7 @@ const BadgeDirective = BaseBadgeDirective.extend('badge', {
|
|||
el.$_pbadgeId = badge.getAttribute('id');
|
||||
|
||||
for (let modifier in binding.modifiers) {
|
||||
!el.unstyled && DomHandler.addClass(badge, 'p-badge-' + modifier);
|
||||
!this.isUnstyled() && DomHandler.addClass(badge, 'p-badge-' + modifier);
|
||||
}
|
||||
|
||||
if (binding.value != null) {
|
||||
|
@ -30,22 +28,22 @@ const BadgeDirective = BaseBadgeDirective.extend('badge', {
|
|||
else el.$_badgeValue = binding.value;
|
||||
badge.appendChild(document.createTextNode(el.$_badgeValue));
|
||||
|
||||
if (String(el.$_badgeValue).length === 1 && !el.unstyled) {
|
||||
!el.unstyled && DomHandler.addClass(badge, 'p-badge-no-gutter');
|
||||
if (String(el.$_badgeValue).length === 1 && !this.isUnstyled()) {
|
||||
!this.isUnstyled() && DomHandler.addClass(badge, 'p-badge-no-gutter');
|
||||
}
|
||||
} else {
|
||||
!el.unstyled && DomHandler.addClass(badge, 'p-badge-dot');
|
||||
!this.isUnstyled() && DomHandler.addClass(badge, 'p-badge-dot');
|
||||
}
|
||||
|
||||
el.setAttribute('data-pd-badge', true);
|
||||
!el.unstyled && DomHandler.addClass(el, 'p-overlay-badge');
|
||||
!this.isUnstyled() && DomHandler.addClass(el, 'p-overlay-badge');
|
||||
el.setAttribute('data-p-overlay-badge', 'true');
|
||||
el.appendChild(badge);
|
||||
|
||||
this.$el = badge;
|
||||
},
|
||||
updated(el, binding) {
|
||||
!el.unstyled && DomHandler.addClass(el, 'p-overlay-badge');
|
||||
!this.isUnstyled() && DomHandler.addClass(el, 'p-overlay-badge');
|
||||
el.setAttribute('data-p-overlay-badge', 'true');
|
||||
|
||||
if (binding.oldValue !== binding.value) {
|
||||
|
@ -54,7 +52,7 @@ const BadgeDirective = BaseBadgeDirective.extend('badge', {
|
|||
if (typeof binding.value === 'object') el.$_badgeValue = binding.value.value;
|
||||
else el.$_badgeValue = binding.value;
|
||||
|
||||
if (!el.unstyled) {
|
||||
if (!this.isUnstyled()) {
|
||||
if (el.$_badgeValue) {
|
||||
if (DomHandler.hasClass(badge, 'p-badge-dot')) DomHandler.removeClass(badge, 'p-badge-dot');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue