Adding new assets

How do I use icons, bitmap graphics and other assets?

Bitmaps

Add bitmap files anywhere under the src/assets/ folder.

src/
    └── assets/
        └── some-dir/
            └── some-bitmap.png

Webpack will resolve any URLs you use to reference to these assets, but it's best to use aliases:

var someBitmapPath = require('@assets/some-dir/some-bitmap.png');
.some-class {
    backgorund-image: url('~@assets/some-dir/some-bitmap.png');
}
<img :src="someBitmapPath">
<img src="~@assets/some-dir/some-bitmap.png">

SVG

src/
    └── svg/
        └── some-asset.svg

Add your SVG in the src/svg/. Webpack will automatically include it in the combined SVG sprite, and it can then be used with one of the <pic> components.

<pic-svg :asset="some-asset"></pic-svg>

results matching ""

    No results matching ""