1.2.0 • Published 5 months ago

vue-sprite v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

npm GitHub package version NPM Downloads

Install

yarn add vue-sprite

Import

import AppIcon from 'vue-sprite'

Use

main.js

import { createApp } from 'vue'
import AppIcon from 'vue-sprite'
import App from './App.vue';

const app = createApp(App)

app.component('AppIcon', AppIcon)
app.mount('#app')

The default path to the sprite file is './sprite.svg'. You can pass your sprite file path:

AppIcon.props.file.default = 'my_file_path/my_file.svg'

sprite.svg

<svg id="sprite" aria-hidden="true" style="width: 0; height: 0; position: absolute;">
	<symbol id="icon-one" viewBox="0 0 100 100">
		<path ... />
	</symbol>
	<symbol id="icon-two" viewBox="0 0 100 100">
		<path ... />
	</symbol>
	...
</svg>

Use icons in any app component

<AppIcon name="icon-one" />

License

vue-sprite is released under MIT license

1.2.0

5 months ago

1.1.0

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago

0.0.1

8 months ago

0.0.1-alpha.3

8 months ago

0.0.1-alpha.2

8 months ago

0.0.1-alpha.1

8 months ago