d2-crud 带斑马纹表格
Former-commit-id: bcae52d5809c0b37ded9c403afaa3368014c30a6 [formerly bcae52d5809c0b37ded9c403afaa3368014c30a6 [formerly bcae52d5809c0b37ded9c403afaa3368014c30a6 [formerly bcae52d5809c0b37ded9c403afaa3368014c30a6 [formerly 0a6b9ebf02f0898a03e2e2eb5bf8707a9027f7f4 [formerly 3be928fb9c57859903f6cc1179001ab4afd0c903]]]]] Former-commit-id: cb1a3799d7152a98af9f69d7b07e759d560d45b4 Former-commit-id: 6e3b6f0807ad073a26ece5b1168456ec06d26954 Former-commit-id: bae445be64d1eac45dc62d9f9622f9fd7251b341 [formerly 7a2a1f2b113a7911702f16dd78f2f16e72525c82] Former-commit-id: d91cf753c577384a5dec1ccfdc4d92b8eaf48e56 Former-commit-id: 6834b79945fb644e7809929f8a66145208cf2931 Former-commit-id: 1041c5f3fece097df722d3de337b70bf55cf3402 Former-commit-id: 70899c992f215e302a08ea72823ca32c41e8dd76 Former-commit-id: 14763df34cba0c66390d77b24045195212ad0d68
This commit is contained in:
@@ -4,6 +4,7 @@ export default {
|
|||||||
icon: 'table',
|
icon: 'table',
|
||||||
children: (pre => [
|
children: (pre => [
|
||||||
{ path: `${pre}index`, title: 'D2 CRUD 首页', icon: 'home' },
|
{ path: `${pre}index`, title: 'D2 CRUD 首页', icon: 'home' },
|
||||||
{ path: `${pre}demo1`, title: '基础表格' }
|
{ path: `${pre}demo1`, title: '基础表格' },
|
||||||
|
{ path: `${pre}demo2`, title: '带斑马纹表格' }
|
||||||
])('/demo/d2-crud/')
|
])('/demo/d2-crud/')
|
||||||
}
|
}
|
||||||
|
|||||||
58
src/pages/demo/d2-crud/demo2/code.js
Normal file
58
src/pages/demo/d2-crud/demo2/code.js
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
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: {
|
||||||
|
stripe: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>`
|
||||||
73
src/pages/demo/d2-crud/demo2/index.vue
Normal file
73
src/pages/demo/d2-crud/demo2/index.vue
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<template>
|
||||||
|
<d2-container>
|
||||||
|
<template slot="header">带斑马纹表格</template>
|
||||||
|
<d2-crud
|
||||||
|
:columns="columns"
|
||||||
|
:data="data"
|
||||||
|
:options="options"/>
|
||||||
|
<el-card shadow="never" class="d2-mb">
|
||||||
|
<p>
|
||||||
|
options对象可以对表格进行配置,其中stripe属性可以创建带斑马纹的表格。它接受一个Boolean,设置为true即为启用。代码如下:
|
||||||
|
</p>
|
||||||
|
</el-card>
|
||||||
|
<el-card shadow="never" class="d2-mb">
|
||||||
|
<d2-highlight :code="code"/>
|
||||||
|
</el-card>
|
||||||
|
<template slot="footer">
|
||||||
|
<d2-link-btn title="D2 CRUD" link="https://github.com/d2-projects/d2-crud"/>
|
||||||
|
</template>
|
||||||
|
</d2-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import code from './code.js'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
code,
|
||||||
|
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: {
|
||||||
|
stripe: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1 +1 @@
|
|||||||
32a7ea0783b0602f53515540de1e323f60edd792
|
c97174e7ff9ee5ba2151eeb570e11a8e7fa2b87e
|
||||||
Reference in New Issue
Block a user