0.0.4 • Published 3 years ago

vue-svg-to-img v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Vue Svg Render

Library component convert svg to png image and this component build for Vue3

Install

$ npm install vue-svg-to-png

How To Use

Use at Single Component
import VueSvgToImg from 'vue-svg-to-png'

export default {
	components: {
		VueSvgToImg
	}
}
Use at Global Component
import { createApp } from 'vue'
import App from './App.vue'
import VueSvgToImg from 'vue-svg-to-png'

createApp(App).use(VueSvgToImg).mount('#app')
<template>
	<VueSvgToImg src="/icons/bubble.svg" color="#800080" :width="320" :height="320" />
</template>

<!-- Dynamic Color -->
<template>
	<VueSvgToImg src="/icons/bubble.svg" color="#800080" color-hover="red" :static="false" :width="320" :height="320" />
</template>

Data

PropertyDescription
srcsource of svg file
widthnumber or string
heightnumber or string
altstring
colorstring example '#000000' or 'red'
color-hoverstring, this property use for dynamic color
staticboolean, this property as options for static image or not
custom-classstring, for customize default component