webpack Assets

在此示例中:

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.

Learn more in the Directory Structure book in the Assets chapter.

Loading CodeSandbox...