Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/regenrek/svginjector-vue
A dynamic inline SVG injection component for vue using SVGInjector
https://github.com/regenrek/svginjector-vue
Last synced: 24 days ago
JSON representation
A dynamic inline SVG injection component for vue using SVGInjector
- Host: GitHub
- URL: https://github.com/regenrek/svginjector-vue
- Owner: regenrek
- Created: 2019-02-09T03:36:52.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-09T22:39:11.000Z (almost 6 years ago)
- Last Synced: 2024-08-08T23:54:19.496Z (5 months ago)
- Language: JavaScript
- Size: 263 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 📦 SVGInjector Module
A dynamic inline SVG injection component for vue using [SVGInjector](https://github.com/iconic/SVGInjector)
## Install
```
# with npm
npm install svginjector-vue# or ...
# with yarn
yarn add svginjector-vue
```## Setup
### Vue Plugin
You can easily register SVGInjector plugin in your app entry point:
```js
import Vue from 'vue'
import SVGInjectorVue from 'svginjector-vue'Vue.use(SVGInjectorVue)
```### Nuxt Module
If you're using nuxt you can include it as module.
```json
modules: [
'svginjector-vue/nuxt',
// or without ssr
['svginjector-vue/nuxt', { ssr:false }]
]
```## Usage
````vue
````### Additional Notes
#### Nuxt Plugin
You can also use SVGInjector as plugin instead of a module
```json
// nuxt.config.js (nuxt.js)plugins: [
'~/plugins/svginjector.js'
]
``````js
// plugins/svginjector.jsimport Vue from 'vue'
import SVGInjectorVue from 'svginjector-vue'Vue.use(SVGInjectorVue)
```#### Usage without SSR
You can use this plugin also without Server side rendering. But it's not recommend.
Just put tag around it
````vue
````### Open Tasks
* Make this plugin more flexible with additional props (if necessary)
### Changelog
* 1.0.1 SSR is working
* 1.0.0 Working version