no message
Former-commit-id: 2a16c2a6cd51fda17d4f865f0ecdf26b03e4c7ee [formerly fac7464138e8d4a1f5fb73c3962e215b73e244e8] [formerly 2a16c2a6cd51fda17d4f865f0ecdf26b03e4c7ee [formerly fac7464138e8d4a1f5fb73c3962e215b73e244e8] [formerly 2a16c2a6cd51fda17d4f865f0ecdf26b03e4c7ee [formerly fac7464138e8d4a1f5fb73c3962e215b73e244e8] [formerly fac7464138e8d4a1f5fb73c3962e215b73e244e8 [formerly 35b769128877ef2fe15d2f65dc4fefb52da0474d [formerly 7f13c5e52752724ac6a6b12968006819f9338741]]]]] Former-commit-id: 48b7967be89b90cad89393e164201516ce29339d Former-commit-id: 0e4a114b158000ac0d4f5114bfa5772fb4fdcc7b Former-commit-id: ad725f9f376237bbbaf52b516580d693589f17bd [formerly fc418f7eda078162b3fd3f7ae0eceedc21108171] Former-commit-id: ee44662669738a9d283d28cbbacf9f63f4f472de Former-commit-id: 142eb2073219f633719e63c8109c997944086021 Former-commit-id: 6adb3a6b462acb42ec5a74764c531d935a1582e7 Former-commit-id: c0fcbcec55cca008a4d416b70e97103a3168f40d Former-commit-id: bb2789f77eb6b39f5ee4ac0f34cf62da0a8701e5
This commit is contained in:
@@ -3,3 +3,5 @@
|
|||||||
| 示例 | 代码与演示 |
|
| 示例 | 代码与演示 |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| 基础表格 | [点我查看](https://fairyever.gitee.io//d2-admin-preview/#/demo/d2-crud/demo1) |
|
| 基础表格 | [点我查看](https://fairyever.gitee.io//d2-admin-preview/#/demo/d2-crud/demo1) |
|
||||||
|
| 带斑马纹表格 | [点我查看](https://fairyever.gitee.io//d2-admin-preview/#/demo/d2-crud/demo2) |
|
||||||
|
| 带边框表格 | [点我查看](https://fairyever.gitee.io//d2-admin-preview/#/demo/d2-crud/demo3) |
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ export default {
|
|||||||
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: '带斑马纹表格' }
|
{ path: `${pre}demo2`, title: '带斑马纹表格' },
|
||||||
|
{ path: `${pre}demo3`, title: '带边框表格' }
|
||||||
])('/demo/d2-crud/')
|
])('/demo/d2-crud/')
|
||||||
}
|
}
|
||||||
|
|||||||
58
src/pages/demo/d2-crud/demo3/code.js
Normal file
58
src/pages/demo/d2-crud/demo3/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: {
|
||||||
|
border: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>`
|
||||||
73
src/pages/demo/d2-crud/demo3/index.vue
Normal file
73
src/pages/demo/d2-crud/demo3/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>
|
||||||
|
默认情况下,D2-Crud是不具有竖直方向的边框的,如果需要,可以在options对象中传入一个border属性,它接受一个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: {
|
||||||
|
border: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1 +1 @@
|
|||||||
c97174e7ff9ee5ba2151eeb570e11a8e7fa2b87e
|
3e7ad2954b31e28ac24d807efc726b59b2b1bd1b
|
||||||
Reference in New Issue
Block a user