Fix rendering of social icons (#14195)

This commit is contained in:
ian
2022-06-30 02:41:13 +08:00
committed by GitHub
parent 288e7d62b9
commit 7a7540ddaa

View File

@@ -11,7 +11,18 @@ export default defineComponent({
},
render() {
const socialIcon = icon(findIconDefinition({ prefix: 'fab', iconName: this.name }));
return h({ template: socialIcon?.html[0] });
if (socialIcon && socialIcon.abstract[0] && socialIcon.abstract[0].children && socialIcon.abstract[0].children[0]) {
return h(
'svg',
{
...socialIcon.abstract[0].attributes,
},
h('path', { ...socialIcon.abstract![0].children![0].attributes })
);
}
return null;
},
});
</script>