Page 1 of 1

Wie kann ich $ ('. Selector'). Flatpickr nicht eine Funktion?

Posted: 30 Apr 2025, 21:12
by Anonymous
I'm using jquery 3.6 and flatpickr 4.6.9 in my project, but when I try to instantiate using my jquery selector, it gives me the following error:

Uncaught TypeError: $datePlanted.flatpickr is not a function

JQuery

Code: Select all

import $ from 'jquery';
import flatpickr from 'flatpickr';

const $datePlanted = $('.plot-tree-form__date-planted-text')
$datePlanted.flatpickr({
enableTime: false,
dateFormat: 'Y-m-d'
});
< /code>
html < /p>


Date Planted Here



Laut Flatpickr -Dokumentation sollte dies funktionieren.
Wie kann ich dieses Problem lösen?