JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://unpkg.com/[email protected]"></script>
<script src="//unpkg.com/element-ui/lib/index.js"></script>
<div id="app">
<el-table
:data="tableData"
border
style="width: 100%">
<el-table-column
prop="date"
label="日期"
min-width="247">
</el-table-column>
<el-table-column
prop="name"
label="姓名"
min-width="180">
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="100">
<template scope="scope">
<el-button @click="handleClick" type="text" size="small">查看</el-button>
<el-button type="text" size="small">编辑</el-button>
</template>
</el-table-column>
</el-table>
</div>
SCSS
@import url("//unpkg.com/element-ui/lib/theme-default/index.css");
Babel + JSX
var a = [{id:1,name:'1111'},{id:1,name:'2222'},{id:3,name:'3333'}]
var b = _.groupBy(a, function(item){
return item.id;
})
const c = _(b).mapValues(([s]) => s);
console.log(c[1]);