Files
mes-ui-d2/src/pages/demo/d2-crud/demo14/index.vue
孙昊翔 0971c234f3 更新文档和预览地址
Former-commit-id: 8accc56d033ea04f8b83687573a0380bdc6d7a86 [formerly 65d8940b3050fa4b8d992022d9296dddede1e210] [formerly 8accc56d033ea04f8b83687573a0380bdc6d7a86 [formerly 65d8940b3050fa4b8d992022d9296dddede1e210] [formerly 8accc56d033ea04f8b83687573a0380bdc6d7a86 [formerly 65d8940b3050fa4b8d992022d9296dddede1e210] [formerly 65d8940b3050fa4b8d992022d9296dddede1e210 [formerly f98f85e9eb450eb22b74cdfc0b44458798d9d438 [formerly 2300ecdf85d8b6fa37d66fc1f12d446950ad3d65]]]]]
Former-commit-id: 7cf6c423338385063c8e5b5914a7ddbad5c76d48
Former-commit-id: 0cc6a694894413bfc50539fb4c25f07caeb255fc
Former-commit-id: cc815d04c6b220fa1e85d6f73b9e86cb72e9a42f [formerly ef139066527a850da9caa028d8dba87aaf9dea55]
Former-commit-id: 2406236172076ea39d706c3c15f05e340bb491e4
Former-commit-id: 0b2680b64b8dd5f105a7e557da935983836ecd5c
Former-commit-id: 427bf1fc262730885f6367a43ac02cf305a76d57
Former-commit-id: 387588ebbd58f8605143ccf26928e797056ef480
Former-commit-id: 2539e02b81df9f4997deab40efef1aff7581ff04
2018-09-03 10:50:22 +08:00

105 lines
2.1 KiB
Vue

<template>
<d2-container>
<template slot="header">合并行</template>
<d2-crud
:columns="columns"
:data="data"
:options="options">
</d2-crud>
<el-card shadow="never" class="d2-mb">
<d2-markdown :source="doc"/>
</el-card>
<el-card shadow="never" class="d2-mb">
<d2-highlight :code="code"/>
</el-card>
<template slot="footer">
<d2-link-btn title="文档" link="https://d2-projects.github.io/d2-admin-doc/zh/ecosystem-d2-crud/"/>
</template>
</d2-container>
</template>
<script>
import doc from './doc.md'
import code from './code.js'
export default {
data () {
return {
doc,
code,
columns: [
{
title: 'ID',
key: 'id'
},
{
title: '姓名',
key: 'name'
},
{
title: '数值 1',
key: 'amount1'
},
{
title: '数值 2',
key: 'amount2'
},
{
title: '数值 3',
key: 'amount3'
}
],
data: [
{
id: '12987122',
name: '王小虎',
amount1: '234',
amount2: '3.2',
amount3: 10
},
{
id: '12987123',
name: '王小虎',
amount1: '165',
amount2: '4.43',
amount3: 12
},
{
id: '12987124',
name: '王小虎',
amount1: '324',
amount2: '1.9',
amount3: 9
},
{
id: '12987125',
name: '王小虎',
amount1: '621',
amount2: '2.2',
amount3: 17
},
{
id: '12987126',
name: '王小虎',
amount1: '539',
amount2: '4.1',
amount3: 15
}
],
options: {
border: true,
spanMethod ({ row, column, rowIndex, columnIndex }) {
if (rowIndex % 2 === 0) {
if (columnIndex === 0) {
return [1, 2]
} else if (columnIndex === 1) {
return [0, 0]
}
}
}
}
}
}
}
</script>