git地址: https://github.com/frangoteam/svgedit 视频搬运: https://www.bilibili.com/video/BV13a411R7q5 demo示例: https://svgedit.netlify.app/editor/index.html
SVGEdit 是一个快速的,基于Web的,JS实现的,SVG画图编辑器,可工作于任何现代浏览器。SVGEdit基于强大的SVG画布库@svgedit/svgcanvas。
当前版本为V7.
使用div集成。
<head>
<!-- You need to include the CSS for SVGEdit somewhere in your application -->
<link href="./svgedit.css" rel="stylesheet" media="all"></link>
</head>
<body>
<!-- svgedit container can be positionned anywhere in the DOM
but it must have a width and a height -->
<div id="container" style="width:100%;height:100vh"></div>
</body>
<script type="module">
/* You need to call the Editor and load it in the <div> */
import Editor from './Editor.js'
/* for available options see the file `docs/tutorials/ConfigOptions.md */
const svgEditor = new Editor(document.getElementById('container'))
/* initialize the Editor */
svgEditor.init()
/* set the configuration */
svgEditor.setConfig({
allowInitialUserOverride: true,
extensions: [],
noDefaultExtensions: false,
userExtensions: []
})
</script>
</html>
基于React扩展