fix(docs): [el-icon] fix svg icon cannot copied issue (#5208)

* fix(docs): [el-icon] fix svg icon cannot copied issue

* Update docs/.vitepress/vitepress/components/globals/icons.vue

* fix: format

Co-authored-by: 三咲智子 <sxzz@sxzz.moe>
This commit is contained in:
msidolphin
2022-01-08 19:49:21 +08:00
committed by GitHub
parent 53c3724b85
commit 32af40ea59

View File

@@ -33,7 +33,7 @@ const copySvgIcon = async (name, refs) => {
if (copyIcon.value) {
await copyContent(`<el-icon><${hyphenate(name)} /></el-icon>`)
} else {
const content = refs[name].querySelector('svg')?.outerHTML ?? ''
const content = refs[name]?.[0].querySelector('svg')?.outerHTML ?? ''
await copyContent(content)
}
}