html 表格实现

javascript 复制代码
<template>
  <div class="nox">
    <table class="hot-table" height='244'>
      <tr>
        <th v-for="(item, index) in headers" :key="index">{{item.label}}</th>
      </tr>
      <tr v-for="(item, index) in evaluationData.list" :key="index">
        <td>{{item.name}}</td>
        <td>{{item.value1}}</td>
        <td>{{item.value2}}</td>
      </tr>
    </table>
  </div>
</template>

<script>
export default {
  data () {
    return {
      headers: [
        { label: '名称', prop: 'key' },
        { label: '数量', prop: 'highRiskNum' },
        { label: '总价', prop: 'highRiskProportion', unit: '%' }
      ],
      evaluationData: {
        list: [
          { name: '9999', value1: '111', value2: '222' },
          { name: '9999', value1: '111', value2: '222' },
          { name: '9999', value1: '111', value2: '222' },
          { name: '9999', value1: '111', value2: '222' },
          { name: '9999', value1: '111', value2: '222' },
          { name: '9999', value1: '111', value2: '222' }
        ]
      }
    }
  }
}
</script>

<style lang="less" scoped>
.nox {
  background: #fff;
}
.hot-table {
  width: 300px;
  th {
    height: 20px;
    font-size: 12px;
    font-weight: normal;
    background: #edf0f5;
    padding-left: 20px;
    color: #404e73;
  }
  td {
    height: 20px;
    font-size: 12px;
    text-align: center;
    border-bottom: 1px solid #f2f3f6;
  }
}
</style>
相关推荐
SwJieJie1 天前
Day 3|表格表单分页范式与 vue-request 最佳实践:从配置驱动到业务落地
前端·javascript·vue.js
ZengLiangYi1 天前
任务队列设计:p-queue 限速 + 重试策略
前端·javascript·后端
sugar__salt1 天前
从零吃透 ES6 核心:变量声明、作用域、变量提升与坑点
前端·javascript·ecmascript·es6
罗超驿1 天前
1.HTML基础入门:标签、属性与路径详解(VSCode开发环境)
前端·vscode·html
Dante丶1 天前
Codex Desktop 不断 Reconnecting 的代理环境变量处理
前端·后端·代码规范
Asmewill1 天前
LangGraph学习笔记五(Command+Send+Runtime)
前端
代码搬运媛1 天前
【前端必知】浏览器原生 API 底层机制详解
前端
咔咔库奇1 天前
js-执行上下文
开发语言·前端·javascript
咪饭只吃一小碗1 天前
JS 打工记:同步搬砖、异步摸鱼,Promise 来救场
前端·javascript·面试
用户713874229001 天前
彻底搞懂浏览器客户端存储:从 localStorage 到完整存储体系
前端