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

[Bug Report] The attribute status of el-progress does not accept the value named 'text' #18062

Open
Astriaporta opened this issue Nov 14, 2019 · 6 comments

Comments

@Astriaporta
Copy link

@Astriaporta Astriaporta commented Nov 14, 2019

Element UI version

2.4.11

OS/Browsers version

Mac OS 11 with Firefox v70.0.1 and Chrome v78.0.3904.97

Vue version

2.5.17

Reproduction Link

https://jsfiddle.net/xj471sm6/

Steps to reproduce

Load the page and see the console log

What is Expected?

The percentage text must appear

What is actually happening?

A cross close appear and in the console, you can see a message said: [Vue warn]: Invalid prop: custom validator check failed for prop "status".

@Astriaporta

This comment has been minimized.

Copy link
Author

@Astriaporta Astriaporta commented Nov 14, 2019

It because the validator of the property does not accept the value. But in the doc it is written that we can add it.

@Astriaporta Astriaporta changed the title [Bug Report] [Bug Report] The attribute status of el-progress does not accept the value named 'text' [Bug Report] The attribute status of el-progress does not accept the value named 'text' Nov 14, 2019
@xrkffgg

This comment has been minimized.

Copy link

@xrkffgg xrkffgg commented Nov 15, 2019

validator: val => ['success', 'exception', 'warning'].indexOf(val) > -1

There is no text

@wangdaodao

This comment has been minimized.

Copy link

@wangdaodao wangdaodao commented Nov 19, 2019

之前老版本是有的,现在最新版删除了,所以升级的时候请谨慎处理!

不过版本变化里面,饿了么团队也不提删掉了哪些,这对开发者不太友好。

@Astriaporta

This comment has been minimized.

Copy link
Author

@Astriaporta Astriaporta commented Nov 20, 2019

It would be nice to add our own text and / or change the size of the text. That's why I followed the recommendations of the doc.

@dengzw

This comment has been minimized.

Copy link

@dengzw dengzw commented Dec 10, 2019

最近也遇到这样的问题,分享下解决方案:
源码中发现props 有个 format (官方文档没有说明,不知道之后会不会删除)

content() {
       if (typeof this.format === 'function') {
         return this.format(this.percentage) || '';
       } else {
         return `${this.percentage}%`;
       }
     }

所以可以通过格式化数据的方式进行修改

https://jsfiddle.net/twndmax4/2/

@ppeinsold

This comment has been minimized.

Copy link

@ppeinsold ppeinsold commented Dec 21, 2019

FYI: The validator allows "null" if you don't want to show a status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.