css-vxe列表中ant进度条与百分比

1.vxe列表 ant进度条

html 复制代码
 <vxe-column field="actualProgress" title="进度" align="center" width="200">
                <template #default="{ row }">
                    <a-progress
                    :percent="Math.floor(row.actualProgress)"
                    size="small"
                    status="active"
                    :stroke-color="{ '0%': '#4DA6FF', '100%': '#C3DCFF' }"
                    />
                </template>
            </vxe-column>

2.列表中的百分比

2.1 html
html 复制代码
<vxe-column field="Ratio" title="百分比" min-width="132" align="center" :formatter="formatProgress">
2.1 js
javascript 复制代码
// 格式化进度
    formatProgress(record) {
        if (record.cellValue != '' && record.cellValue != null) {
            return this.showProgress(record.cellValue)
        } else {
            return '--'
        }
    },
    // 百分比展示
    showProgress(num) {
      let ps = 0 > num ? -1 * Math.floor(-1 * num) : Math.floor(num);
      return ps + "%";
    },

3.返回是否有值判断

javascript 复制代码
 // 返回是否有值
        getConnect({ cellValue }) {
            if (cellValue != null) {
                return cellValue
            } else {
                return '--'
            }
        },
相关推荐
哈基米喜欢哈哈哈12 分钟前
Spring Boot 3.5 新特性
java·spring boot·后端
hellokai42 分钟前
React Native新架构源码分析
android·前端·react native
##学无止境##1 小时前
Java设计模式-观察者模式
java·观察者模式·设计模式
David爱编程1 小时前
可见性问题的真实案例:为什么线程看不到最新的值?
java·后端
li理1 小时前
鸿蒙应用开发完全指南:深度解析UIAbility、页面与导航的生命周期
前端·harmonyos
whitepure1 小时前
我如何理解与追求整洁代码
java·后端·代码规范
去伪存真1 小时前
因为rolldown-vite比vite打包速度快, 所以必须把rolldown-vite在项目中用起来🤺
前端
KubeSphere1 小时前
Kubernetes v1.34 重磅发布:调度更快,安全更强,AI 资源管理全面进化
前端
用户8356290780511 小时前
Java高效读取Excel表格数据教程
java·后端
yinke小琪1 小时前
今天解析一下从代码到架构:Java后端开发的"破局"与"新生"
java·后端·架构