M
M
MeMoJlor2021-12-24 10:34:26
Vue.js
MeMoJlor, 2021-12-24 10:34:26

Where to write styles for a component in nuxt.js?

Good afternoon. I know Nuxt has common styles in assets/style.css, but what about the styles I want to apply to components? Will the standard structure of regular vue work? If I create a style in the component, then in the "View source page" all the styles appear on the page, is this normal?
61c577e499b16592290957.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WapSter, 2021-12-24
@wapster92

nuxt.config.js

// Build Configuration: https://go.nuxtjs.dev/config-build
export default {
 // ...
  build: {
    extractCSS: process.env.NODE_ENV === 'production', // если true разобьет css по файлам
  },
 // ..
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question