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
refactor(utils): refactor iconPropType
#9502
Conversation
SuggestDue to this change, I think the type of icon props description in the document should also change. What do you think? ex. https://element-plus.org/en-US/component/link.html#attributes |
You're right! I forget it and I will add later. |
🧪 Playground Preview: https://element-plus.run/?pr=9502 |
iconTypes
iconPropType
Maybe the string type should not be removed. When globally register the Icon components, we can pass a string to use the icon. // main.ts
import { Edit } from '@element-plus/icons-vue'
createApp(App).component('icon-edit', Edit).mount('#app') <template>
<el-button
type="primary"
icon="icon-edit"
circle
/>
<el-link
type="primary"
icon="icon-edit"
circle
>
Link
</el-link>
<el-input suffix-icon="icon-edit" />
</template> |
I haven't found a use case for passing string, turns out it's here! I'll create a PR later to fix this. |
The Component type contains the function component type( type True = (() => VNode) extends Component ? true : false |
Sorry for my carelessness. 😅 |
Please make sure these boxes are checked before submitting your PR, thank you!
dev
branch.