Skip to content
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

unocss问题 #69

Open
gitborlando opened this issue Jan 7, 2025 · 1 comment
Open

unocss问题 #69

gitborlando opened this issue Jan 7, 2025 · 1 comment

Comments

@gitborlando
Copy link

你有没有碰到unocss样式覆盖的问题, 就是比如

//自己封装的组件
const ComponetA = ({className}) => <div className={`w-100 ${className}`}>a</div/>
//在外面使用
const ComponetB = () => <div><ComponetA className='w-200'/></div/>

A组件默认宽度是100px, 在外层调用时加个w-200类名覆盖原样式, 期望是变成200px, 但不能覆盖成功, 宽度还是100px,
这种情况应该怎么办

@gitborlando
Copy link
Author

除了在前面加 !, 还有更好的办法吗

@gitborlando gitborlando reopened this Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant