我试图在我的项目中使用 Flowbite 组件,但它们不起作用(例如下拉菜单、模态菜单……)。
我遵循了文档,但没有任何作用。
我使用的是 vuejs 3,Vite v2.9.9。
这是我的main.js
文件:
import { createApp } from 'vue'
import App from "@/App.vue";
import router from './router/index'
import store from './state/store'
// Imported css file [TailwindCSS]
import './index.css'
// Imported flowbite
import 'flowbite';
createApp(App)
.use(router)
.use(store)
.mount('#app')
Run Code Online (Sandbox Code Playgroud)
模态.vue
<template>
<!-- Modal toggle -->
<button class="block text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800" type="button" data-modal-toggle="default-modal">
Toggle modal
</button>
<!-- Main modal -->
<div id="default-modal" aria-hidden="true" class="hidden …
Run Code Online (Sandbox Code Playgroud)