travel/admin/node_modules/svg-sprite-loader/examples/browser-sprite
yaosen 242417d45d init... 2024-06-24 11:28:18 +08:00
..
build init... 2024-06-24 11:28:18 +08:00
README.md init... 2024-06-24 11:28:18 +08:00
demo.html init... 2024-06-24 11:28:18 +08:00
main.js init... 2024-06-24 11:28:18 +08:00
webpack.config.js init... 2024-06-24 11:28:18 +08:00

README.md

Default browser runtime example

In browser sprite is rendered and injected in page automatically, you just refer to images via <svg><use xlink:href="#id"></use></svg>.

Demo

Input

import twitterIcon from '../assets/twitter.svg';

Reference in HTML

<svg>
  <use xlink:href="#twitter"></use>
</svg>

Input

Output