primefaces / community

Community Forum
0 stars 0 forks source link

Changing Theme fails on Vue 3 PrimeVue #1120

Open Aleroms opened 5 months ago

Aleroms commented 5 months ago

Discussed in https://github.com/orgs/primefaces/discussions/1022

Originally posted by **Aleroms** January 25, 2024 Hello, I've tried to the best of my abilities to follow the [documentation](https://primevue.org/theming/#switchthemes) on switching themes but have not had success. When I inspect the page, I view changes in the head, specifically the link element, where it does reflect changes. My `href` attribute changes from `` to ``, however, the actual theme does not change. I have created a test app with just this implemented in my repo [changeTheme_PrimeVue](https://github.com/Aleroms/changeTheme_PrimeVue) as well as a [live site](https://changetheme-primevue.netlify.app/) example. Here are the steps I took to create this below. how to replicate: create vue app `npm init vue@latest` install primevue `npm install primevue` in `main.js` register plugin and import theme `import 'primevue/resources/themes/lara-light-green/theme.css'` `import "primevue/resources/themes/lara-dark-green/theme.css";` copy themes from PrimeVue `resources/themes` folder into `public/themes` place `link` in `index.html` `` copy and paste code from [App.vue](https://github.com/Aleroms/changeTheme_PrimeVue/blob/main/src/App.vue) into `App.vue` run `dev` `npm run dev`