vuepress-reco / vuepress-theme-reco

🎨 This is the repo for vuepress-theme-reco 2.
https://vuepress-theme-reco.recoluan.com
MIT License
539 stars 175 forks source link

fix: optimize Xicons #151

Closed zhaopan-pan closed 1 year ago

zhaopan-pan commented 1 year ago

Xicons.vue. The vue component can not only render an icon with linked text, but also render an icon separately. I think the original intention of this component design. The link has a default value of 'javascript: void (0)', so when using the Xicons component, I just want to get an icon. I did not pass the link to it, but I still got an a tag. This is a bit illogical because it seems that the following code will never be executed: <component v-else :style="iconStyle" :is="icons[icon]" /> I think whether to use the a tag is decided by the component user, not by Xicons.So I created this pr, which has passed the local test and pnpm example: build

recoluan commented 1 year ago

I think you're right. 👍

Xicons.vue. The vue component can not only render an icon with linked text, but also render an icon separately. I think the original intention of this component design. The link has a default value of 'javascript: void (0)', so when using the Xicons component, I just want to get an icon. I did not pass the link to it, but I still got an a tag. This is a bit illogical because it seems that the following code will never be executed: <component v-else :style="iconStyle" :is="icons[icon]" /> I think whether to use the a tag is decided by the component user, not by Xicons.So I created this pr, which has passed the local test and pnpm example: build