Liad Goren
Liad Goren

Reputation: 319

Vue3 Functional Component render function Primevue Tooltip

rowTooltip: (createElement, cell, property, context) => {
            return withDirectives(createElement("div",  "any value"), ["tooltip", "is this the tooltip value?", "is this the value actually?", "no this is the value argument"]);
        },

how do I render this tooltip directive : https://www.primefaces.org/primevue/tooltip

inside a render function loop inside a functional component with vue3.

I've been trying for hours

added a fork with my problem

Upvotes: 0

Views: 1355

Answers (1)

Art Hitrick
Art Hitrick

Reputation: 145

vue3 has function h

using with setup function:

setup() {
  const tooltip = resolveDirective('tooltip');

  return () => {
    const vnode = withDirectives(
      h(Button, { label: "I'am dynamic button, hover me too" }),
      [[tooltip, 'tooltip directive with render function']]
    );

    return vnode;
  };
}

example: https://stackblitz.com/edit/vue-gg76si?file=src/main.js

Upvotes: 2

Related Questions