0.7.0 • Published 4 years ago

svg-to-vue v0.7.0

Weekly downloads
92,247
License
MIT
Repository
github
Last release
4 years ago

Instalation

npm i svg-to-vue vue-template-compiler

yarn add svg-to-vue vue-template-compiler

Usage

const svgToVue = require('svg-to-vue');

const code = `
  <svg width="300" height="200" xmlns="http://www.w3.org/2000/svg">
    <rect width="100%" height="100%" fill="red" />
  </svg>
`;

svgToVue(code)
  .then((component) => {
    // `component` contains Vue component definition
    console.log(component);
  });

API

svgToVue(code, {
  svgoConfig: {
    plugins: [
      {
        prefixIds: true,
      },
    ],
  },
  svgoPath: 'some/path/to.svg',
});
NameTypeDefault valueDescription
svgoConfigObject/Boolean{}Configuration object passed to SVGO or false to disable optimization
svgoPathStringnullPath to SVG file which is used by SVGO prefixIds plugin to generate unique IDs
0.7.0

4 years ago

0.6.0

4 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.4.0-alpha.1

5 years ago

0.3.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago