ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.1k stars 14.64k forks source link

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

Open Astriaporta opened 4 years ago

Astriaporta commented 4 years ago

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 commented 4 years ago

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

xrkffgg commented 4 years ago

https://github.com/ElemeFE/element/blob/57e90078935fcf7efedbf07c3a3a1a492ba37f77/packages/progress/src/progress.vue#L70

There is no text

wangdaodao commented 4 years ago

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

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

Astriaporta commented 4 years ago

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 commented 4 years ago

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

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

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

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

ppeinsold commented 4 years ago

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

stale[bot] commented 3 years ago

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.