Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

wxc-button的计算属性中引用了未知type #268

Closed
carrypann opened this issue May 17, 2018 · 3 comments
Closed

wxc-button的计算属性中引用了未知type #268

carrypann opened this issue May 17, 2018 · 3 comments

Comments

@carrypann
Copy link

1.Your development environment(weex、weex-toolkit、system and more).
  • weex-toolkit
2.Expected behavior and actual behavior.
  • 在使用wxc-button的时候,如果状态发生改变,比如disabled=true 变为 disabled=false,在按钮样式中的文字颜色会变成黑色。经查阅源码,发现在wxc-button/index.vue 61行中代码如下
        const mrTextStyle = { ...TEXT_STYLE_MAP[type], ...textStyle, ...TEXT_FONTSIZE_STYLE_MAP[size] };
  • 再去type.js中找到TEXT_STYLE_MAP的定义如下:
export const TEXT_STYLE_MAP = {
  taobao: {
    color: '#FFFFFF'
  },
  fliggy: {
    color: '#3D3D3D'
  },
  white: {
    color: '#3D3D3D'
  }
};
  • 而新版本中type的可选值为whiteredyellowblueTEXT_STYLE_MAP中为taobaofliggywhite,假如我使用type=red,在TEXT_STYLE_MAP就找不到该属性,因此计算属性最后的结果会将按钮文字赋为默认的#000000黑色。
3.Steps to reproduce the problem.
  • 如上。
@tw93
Copy link
Member

tw93 commented May 18, 2018

谢谢反馈,@GJJDD 跟进一下哦

@tw93
Copy link
Member

tw93 commented Jun 1, 2018

已经修复,请升级到 weex-ui@0.6.4-beta版本

npm i weex-ui@latest -S

@tw93 tw93 closed this as completed Jun 1, 2018
@yinianjiqi
Copy link

wxc*button里的事件回调@wxcButtonClicked="wxcButtonClicked"应该怎么回调啊?我是初学者有点不会回调

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants