0

Im trying to implement a simple dialog, but the styles dont apply like it would do This is the component

    <template>
    <div class="card flex justify-center">
        <Dialog v-model:visible="dialogVisible" modal header="Register Accountant" :style="{ width: '25rem'}">
            <div class="flex items-center gap-4 mb-4">
                <label for="name" class="font-semibold w-24">Name</label>
                <InputText v-model="name" required id="name" class="flex-auto" autocomplete="off"></InputText>
            </div>
            <div class="flex items-center gap-4 mb-4">
                <label for="birthDate" class="font-semibold w-24">Birth date</label>
                <DatePicker v-model="birthDate" name="birthDate" fluid/>
            </div>
            <div class="flex justify-end gap-4">
                <Button label="Save" @click="saveAccountant" />
            </div>
        </Dialog>
    </div>
</template>

In main.ts I only implement primevue, because it throws error when I tried to import any css from Primevue

import './assets/main.css'
import PrimeVue from 'primevue/config'
import { createApp } from 'vue'
import App from './App.vue'
import '/node_modules/primeflex/primeflex.css';
import "primeicons/primeicons.css";


const app = createApp(App)
app.use(PrimeVue)
app.mount('#app')

I have installed: @primeuix/themes, @primevue/themes, primevue, primeflex and prime

Here is an example how look the dialog: Dialog being overlapped into another component

3
  • I think you must set the theme. Look the docs: primevue.org/vite Commented Jun 27 at 9:37
  • can you create a codepen with reproduce issue ? Commented Jun 27 at 10:19
  • 1
    Try importing a theme; see docs as @Flo suggested. Like this: import Aura from '@primeuix/themes/aura' Commented Jun 27 at 11:44

1 Answer 1

0
import './assets/main.css'
import PrimeVue from 'primevue/config'
import Aura from '@primeuix/themes/aura';
import Dialog from 'primevue/dialog';
import Button from "primevue/button"
import { createApp } from 'vue'
import App from './App.vue'
import '/node_modules/primeflex/primeflex.css';
import "primeicons/primeicons.css";

const app = createApp(App)

app.component('Button', Button);
app.component('Dialog', Dialog);
app.use(PrimeVue, {
    theme: {
        preset: Aura
    }
});
app.mount('#app')

From version 4 onwards, you must import one of the themes.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.