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

fix(Dialog): fix button color with different theme #5723

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

johnsonwong666
Copy link
Collaborator

#5722 当theme为round-button时 confirmButtonColor的默认值RED被透传 需要判断处理一下

@@ -13,6 +13,7 @@ VantComponent({
type: Boolean,
observer(show: boolean) {
!show && this.stopLoading();
this.handleButtonColor();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是不是可以通过 wxs 来实现,性能会好一点

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已调整使用wxs

var RED = '#ee0a24';
var WHITE = '#fff';
var GRAY = '#323233';
function buttonColor(data) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里有两个改造思路,一个是 RED 这些JS变量是不是可以用全局的 CSS 变量,这里本身是 style,理论上是可以用的,避免在维护一套JS的样式变量

另外一个是这个函数是不是可以统一改造根据不同的条件回生效不同的样式,目前的实现可复用度比较低

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

Successfully merging this pull request may close these issues.

None yet

2 participants