forked from damianstasik/svg-to-vue
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1cba729
commit 5be1902
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<h1 align="center">svg-to-vue</h1> | ||
<p align="center">Utility to convert SVG code into Vue component definition</p> | ||
|
||
## Instalation | ||
``` bash | ||
npm i svg-to-vue | ||
|
||
yarn add svg-to-vue | ||
``` | ||
|
||
## Usage | ||
``` js | ||
const svgToVue = require('svg-to-vue'); | ||
|
||
const svg = ` | ||
<svg width="300" height="200" xmlns="http://www.w3.org/2000/svg"> | ||
<rect width="100%" height="100%" fill="red" /> | ||
</svg> | ||
`; | ||
|
||
svgToVue(svg) | ||
.then((component) => { | ||
// `component` contains Vue component definition | ||
console.log(component); | ||
}); | ||
``` |