1.1.3 • Published 2 years ago

svg-loader-vue v1.1.3

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

npm version

Vue.js svg loader

Setup

package install

npm install --save svg-loader-vue

main.js

import { createApp } from 'vue'
import App from './App.vue'
import SvgLoader from 'svg-loader-vue'

const app = createApp(App)
app.use(SvgLoader)

Usage

In a component that needs to load an svg file, use it as follows.

<template>
    <svg-loader :svgFile='peopleSvg' />
</template>

<script>
    import people from '@/assets/people.svg'

    export default {
        data: function () {
            return {
                peopleSvg: people,
            }
        }
    }
</script>

Props

Styling must be set using props

<svg-loader 
    :svgFile='peopleSvg'
    width=100
    height=100
    fill='blue'
/>
NameTypeDefaultDescription
svgFileStringnullPath of the svg file to load.
fillString'black'color of svg element, can be string.
widthNumbersvg original widthWidth of svg element, can be number.
heightNumbersvg original heightHeight of svg element, can be number.
viewBoxStringsvg original viewBoxEnlarge or reduce the size and position of the svg element.Valid values: '0 0 16 16'
1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago