htmlstreamofficial / preline

Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.
https://preline.co
MIT License
3.96k stars 263 forks source link

关于如何在React Vite ts中激活js交互的参考 #368

Open ningmengchongshui opened 1 month ago

ningmengchongshui commented 1 month ago
npm install preline 
import { HSStaticMethods } from 'preline';
HSStaticMethods.autoInit();
const observer = new MutationObserver(mutationsList => {
  for (const _ of mutationsList) {
    HSStaticMethods.autoInit();
  }
});
observer.observe(document.body, {
  attributes: true,
  subtree: true,
  childList: true,
  characterData: true
});