d2-crud 带状态表格
Former-commit-id: aedacbb884050bcbeba78dd93d47d8c02d569ca1 [formerly aedacbb884050bcbeba78dd93d47d8c02d569ca1 [formerly aedacbb884050bcbeba78dd93d47d8c02d569ca1 [formerly aedacbb884050bcbeba78dd93d47d8c02d569ca1 [formerly ce8ae5380804ac0d94aea1f143abd516b13919d5 [formerly 6a53e667ed4edda557ff526b3d9d35515ccd4483]]]]] Former-commit-id: 5a8675d99ef0308aac368cc28d8a3aca90d610c6 Former-commit-id: d22b37bc78dc3eeac87946bb9607987c7cf23dc5 Former-commit-id: fc72d7367b05034cf21eac251c962242e0427306 [formerly 907af2041fe52543e30f08fc23499e92ade73ccb] Former-commit-id: 5a72d7ba890bcb341e77695610bab39e3e630335 Former-commit-id: 8204a10ee32924f1a5ac6d294d46a089cf5b7d3a Former-commit-id: 52a4ee4ef3a6d5b007195fcbe8a9361c9dd6cce9 Former-commit-id: b36beb64839ecbd2ac7dcf47d3f0f98c9649faa1 Former-commit-id: f28040967965e0354bb0c42c417ed8c4e0557d69
This commit is contained in:
75
src/pages/demo/d2-crud/demo4/code.js
Normal file
75
src/pages/demo/d2-crud/demo4/code.js
Normal file
@@ -0,0 +1,75 @@
|
||||
export default `<template>
|
||||
<div>
|
||||
<d2-crud
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
:options="options"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
columns: [
|
||||
{
|
||||
title: '日期',
|
||||
key: 'date',
|
||||
width: '180'
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
key: 'name',
|
||||
width: '180'
|
||||
},
|
||||
{
|
||||
title: '地址',
|
||||
key: 'address'
|
||||
}
|
||||
],
|
||||
data: [
|
||||
{
|
||||
date: '2016-05-02',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1518 弄'
|
||||
},
|
||||
{
|
||||
date: '2016-05-04',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1517 弄'
|
||||
},
|
||||
{
|
||||
date: '2016-05-01',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1519 弄'
|
||||
},
|
||||
{
|
||||
date: '2016-05-03',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1516 弄'
|
||||
}
|
||||
],
|
||||
options: {
|
||||
rowClassName ({row, rowIndex}) {
|
||||
if (rowIndex === 1) {
|
||||
return 'warning-row'
|
||||
} else if (rowIndex === 3) {
|
||||
return 'success-row'
|
||||
}
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>`
|
||||
Reference in New Issue
Block a user