vue-svg-icon icon indicating copy to clipboard operation
vue-svg-icon copied to clipboard

xml.svg undefine

Open moox2020 opened this issue 2 years ago • 0 comments

vue.runtime.esm.js?c320:3049 TypeError: Cannot read properties of undefined (reading '$') at VueComponent.icon (Icon.vue?539a:78:1)

对应的代码: icon() { let xml = require(!xml-loader!../../src/svg/${this.name}.svg); const t = xml.svg.$.viewBox.split(' '); // 这里报错,xml存在,但xml.svg undefine ,xml.svg.$ 自然也undefine console.info(src/svg/${this.name}.svg has been loaded); return { width: t[2], height: t[3], paths: convert.SVGtoArray(xml.svg) } },

我的代码:已正常 npm install vue-svg-icon --save-dev

moox2020 avatar Nov 23 '22 12:11 moox2020