I want to import css in my plugin vue if a variable is true but when what i have do, load css after app was mount
Install.js of my plugin
import FormGroup from './components/formGroup/FormGroup.vue'
export default {
async install(Vue, variable) {
if(variable)
await import('./styles/common/input.css')
Vue.component('lv-form-group', FormGroup)
}
}
My main.js of my vue project :
import { createApp } from 'vue'
import App from './App.vue'
import router from './router/router.js'
import i18n from './translations/i18n.js'
import './styles/_import.css'
import lightVue from './install'
const app = createApp(App)
app.use(lightVue, true)
app.use(router)
app.use(i18n)
app.mount('#app')
When i run my app, the style is applied after my app mount