✨ [Feature]: Button 按钮,为什么图标没有插槽功能还有指定按钮风格api,比如方形
What problem does this feature solve
What does the proposed API look like
没有
What is your project name
quark
Bot detected the issue body's language is not English, translate it automatically.
Title: ✨ [Feature]: Button button, why does the icon have no slot function and specify button style API, such as square
问题:假设有个场景,你们官方图标太少,我自定义图标咋办,又要方形去显示?是不是应该需要图标插槽方式去实现,然后指定按钮是方形?
回复: 1、 自定义图标咋办: icon属性,支持传入任何的vue组件。 自己写一个svg的组件传入即可。 2、也可以选择不传入icon属性, 在button的默认插槽中,传入图标组件 + 文字 。 但这种情况,不会显示方形,只会显示普通的button
Bot detected the issue body's language is not English, translate it automatically.
Question: Suppose there is a scenario where your official icons are too few. What should I do if I customize the icons and need them to be displayed in a square shape? Should I need to use the icon slot method to implement it, and then specify the button to be square?
Reply:
- What to do with custom icons: The icon attribute supports passing in any vue component. Just write an svg component yourself and pass it in.
- You can also choose not to pass in the icon attribute. In the default slot of the button, pass in the icon component + text. But in this case, the square will not be displayed, only the ordinary button will be displayed.