Protip icon indicating copy to clipboard operation
Protip copied to clipboard

reactive text

Open nincorada opened this issue 5 years ago • 3 comments

How can i make the displayed text reactive? I am using this with vue and vue-i18n, a translator. I am passing the data from computed into :data-pt-title="sTooltip" and sTooltip is in the computed object that returns this.$i18n.t('path-to-text')

nincorada avatar May 06 '20 03:05 nincorada

You can try to add data-pt-observer="true". This will watch for attribute changes also.

wintercounter avatar May 06 '20 07:05 wintercounter

the page freezed when i added that attribute

nincorada avatar May 06 '20 08:05 nincorada

I never used Vue with jQuery, but I'm pretty sure it's an anti-pattern in general. I think you'll need to force a rerender or something, so the old tooltip element will be removed, and a new will be added.

Alternatively you can also set it manually using $(el).protipSet({ title: 'My title' }).

wintercounter avatar May 06 '20 11:05 wintercounter