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 · 7 comments
Labels

Comments

@Astriaporta
Copy link

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
Copy link
Author

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
Copy link

xrkffgg commented Nov 15, 2019

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

There is no text

@wangdaodao
Copy link
Contributor

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

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

@Astriaporta
Copy link
Author

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.

@ylater
Copy link

ylater 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
Copy link

ppeinsold commented Dec 21, 2019

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

@stale
Copy link

stale bot commented Dec 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants