webpack Assets

Use the assets folder to add css, images and fonts to your application


In this example:

pages/index.vue shows:

  • how to add an image from the assets folder.
  • how to add a background image from the assets folder using CSS.
  • how to add dynamic images from the assets folder using the data property.

nuxt.config.js contains the css property for globally adding a css file.

assets/main.css shows how to reference the DMSans fonts from the assets folder using the @font-face rule.

Loading Sandbox...
Editer cette page sur GitHub Mise à jour le Mon, July 12, 2021