【发布时间】:2019-11-08 21:26:46
【问题描述】:
谁能告诉我如何让 SVG.js 插件在 Node.js 中工作。我正在使用这样的 svgdom,它为我提供了一个简单矩形的 svg 代码:
const window = require('svgdom')
const document = window.document
const {SVG, registerWindow} = require('@svgdotjs/svg.js')
registerWindow(window, document)
const canvas = SVG(document.documentElement)
canvas.rect(100,100).fill('yellow').move(50,50)
console.log(canvas.svg())
我想使用 svg.path.js。我应该把 svg.path.js 文件放在哪里,在上面的代码中我如何要求它?
【问题讨论】: