I’m testing out PrimeVue. Created a simple timestamp template that is being imported and displayed in the main App.vue template. See the following code. timestamp and local_timestamp show up correctly in the template. However, the tooltip is not working. If I use a string instead of the computed property, it shows up fine. The console gives the following error: main.js:29 TypeError: r.value.value.trim is not a function
That is referencing the following line of code from PrimeVue’s Tooltip component.
https://github.com/primefaces/primevue/blob/master/packages/primevue/src/tooltip/Tooltip.js#L25
Any idea what I’m missing here?
<template>
<div v-tooltip="{ value: local_timestamp }">
{{ timestamp }}
</div>
{{ local_timestamp }}
</template>
<script setup>
import { computed, defineProps } from 'vue'
const props = defineProps({
timestamp: {
type: String,
required: true
}
})
const local_timestamp = computed(() => {
return new Date(props.timestamp)
})
</script>
I’ve been referencing the PrimeVue documentation here: https://primevue.org/tooltip/