Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svgBuilder坑 #1

Open
lsg1998 opened this issue Feb 28, 2023 · 2 comments
Open

svgBuilder坑 #1

lsg1998 opened this issue Feb 28, 2023 · 2 comments

Comments

@lsg1998
Copy link

lsg1998 commented Feb 28, 2023

svgBuilder.js 这个有问题,如果我的标签里面稍微带点东西就会导致svg标签无法显示....太坑了

@lsg1998
Copy link
Author

lsg1998 commented Feb 28, 2023

export const svgBuilder = (path, perfix = 'icon') => {
if (path === '') return
idPerfix = perfix
const res = findSvgFile(path)
console.log(res.length,'length')
// console.log(res)
// const res = []
return {
name: 'svg-transform',
transformIndexHtml(html) {
return html.replace(
'',
<body> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="position: absolute; width: 0; height: 0"> ${res.join('')} </svg>
)
},
}
}

@qwfy5287
Copy link
Owner

qwfy5287 commented Mar 1, 2023

看不懂,你解决下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants