Hi, I've followed this guide to integrate Metronic 9 with Vuejs. I'm running Vue router so, as mentioned in the guide, I'm initializing KTComponent like this:
// index.ts
import KTComponent from '../metronic/core/index.ts;
import KTLayout from '../metronic/app/layouts/demo1.js';
router.beforeEach(() => {
KTComponent.init();
KTLayout.init();
});
However, when I try running a component inside a view it doesn't work. When I paste a tooltip inside a view, for example:
<button class="btn btn-primary" data-tooltip="#default_tooltip">
Toggle Tooltop
</button>
<div class="tooltip" id="default_tooltip">
Hey, a delightful tooltip is here!
</div>
It doesn't work. But if I initialize the component like this it works:
import KTTooltip from '../metronic/core/index.ts';
KTTooltip.init()
There must be an issue in the way components are getting initialized inside KTComponent.
Hi,
Thank you for the heads-up. We will check it further and get back to you shortly.
Regards.
Hi,
Sorry for the late reply.
May I know which version you are using? Have you checked it with the latest Metronic v9.0.3 ?
We have also updated the React Integration Guide and React Starterkit as well.
Regards,
Sean
Hi,
Sorry for the late reply.
We have tried using our tooltip component on react-router page and tooltips get initialized correctly.
Do you still have the KTTooltip.init() trigger in the function KTComponent.init()?
Are you getting any errors in your browser console?
Regards, Lauris Stepanovs, Keenthemes Support Team