Closed katOstrynska closed 4 years ago
I would like to use this plugin in my Vuejs project, but I have problems with setting it right. When in my component I use basic example:
const TextToSVG = require('text-to-svg'); const textToSVG = TextToSVG.loadSync(); const svg = textToSVG.getSVG('hello'); console.log(svg);
I got TypeError: fs.readFileSync is not a function error.
fs是nodejs的内建模块。建议在nodejs服务中提供一个接口,前端再去请求。
fs is a built-in module of nodejs. It is recommended to provide an interface in the nodejs service, and then request it from the front end.
I would like to use this plugin in my Vuejs project, but I have problems with setting it right. When in my component I use basic example:
const TextToSVG = require('text-to-svg'); const textToSVG = TextToSVG.loadSync(); const svg = textToSVG.getSVG('hello'); console.log(svg);
I got TypeError: fs.readFileSync is not a function error.