Commit e3582dd7 authored by zhanglw's avatar zhanglw

调整

parent 78fb4176
<template>
<el-table-column :prop="col.prop" :label="col.label">
<template v-if="col.children">
<custom-column v-for="(item, index) in col.children" :key="index" :col="item" />
</template>
</el-table-column>
</template>
<script>
export default {
name: 'CustomColumn',
props: {
col: {
type: Object
}
}
}
</script>
<style scoped>
</style>
<template>
<div class="my-table">
<el-table :data="data" :span-method="spanMethod">
<custom-column v-for="(item,index) in col" :key="index" :col="item" />
</el-table>
</div>
</template>
<script>
import CustomColumn from './column'
export default {
components: {
CustomColumn
},
props: {
col: {
type: Array,
required: true,
default: () => { return [] }
},
data: {
type: Array,
required: true,
default: () => { return [] }
},
spanMethod: {
type: Function,
required: false,
default: function() { }
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<custom-table :col="col" :data="data" :span-method="arraySpanMethod" />
</div>
</template>
<script>
import CustomTable from '@/components/CustomTable'
/*
*/
export default {
components: {
CustomTable
},
data() {
return {
col: [
{
prop: 'date',
label: '日期'
},
{
label: '配送信息',
children: [
{
prop: 'name',
label: '姓名'
},
{
label: '地址',
children: [
{
prop: 'province',
label: '省份'
},
{
prop: 'city',
label: '市区'
},
{
prop: 'address',
label: '地址'
}
]
}
]
}
],
data: [
{
date: '2016-05-03',
name: '王小虎',
province: '上海',
city: '普陀区',
address: '上海市普陀区金沙江路 1518 弄',
span: [
[1, 2], [1, 0], [2, 1], [1, 1], [1, 1]
]
},
{
date: '2016-05-02',
name: '王小虎',
province: '上海',
city: '普陀区',
address: '上海市普陀区金沙江路 1518 弄',
span: [
[1, 1], [1, 1], [0, 1], [1, 1], [1, 1]
]
}
]
}
},
methods: {
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
return row.span[columnIndex]
}
}
}
</script>
<style>
</style>
......@@ -54,7 +54,7 @@
<span v-else>登 录 中...</span>
</el-button>
<div class="login-remember" style="margin: 10px 0">
<span class="underline touch" @click="changeMode(3)">去注册</span>
<span class="underline touch" style="font-size: 17px" @click="changeMode(3)">去注册</span>
</div>
</el-form-item>
<el-form-item v-show="mode===3" style="width:100%;">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment