2018-03-23 10:21:49 +08:00
|
|
|
<template>
|
|
|
|
|
<Container type="card-full">
|
2018-03-23 10:34:52 +08:00
|
|
|
<template slot="header">
|
|
|
|
|
<el-button type="primary" @click="ajax">
|
|
|
|
|
<Icon name="paper-plane"></Icon>
|
|
|
|
|
发送请求
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
2018-03-23 11:00:48 +08:00
|
|
|
<el-table v-bind="table">
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="id"
|
|
|
|
|
label="id"
|
|
|
|
|
width="50"
|
|
|
|
|
align="center">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="name"
|
|
|
|
|
label="姓名"
|
|
|
|
|
width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input
|
|
|
|
|
v-bind="inputSetting"
|
|
|
|
|
placeholder="姓名">
|
|
|
|
|
</el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="address1"
|
|
|
|
|
label="出生地">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input
|
|
|
|
|
v-bind="inputSetting"
|
|
|
|
|
placeholder="出生地">
|
|
|
|
|
</el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="address2"
|
|
|
|
|
label="现居地">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input
|
|
|
|
|
v-bind="inputSetting"
|
|
|
|
|
placeholder="现居地">
|
|
|
|
|
</el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
2018-03-23 10:21:49 +08:00
|
|
|
</Container>
|
|
|
|
|
</template>
|
2018-03-23 10:34:52 +08:00
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import Mock from 'mockjs'
|
|
|
|
|
export default {
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
table: {
|
|
|
|
|
data: [],
|
|
|
|
|
size: 'mini',
|
|
|
|
|
stripe: true,
|
|
|
|
|
border: true
|
2018-03-23 11:00:48 +08:00
|
|
|
},
|
|
|
|
|
inputSetting: {
|
2018-03-23 11:06:20 +08:00
|
|
|
size: 'small'
|
2018-03-23 10:34:52 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
ajax () {
|
2018-03-23 11:00:48 +08:00
|
|
|
this.table.data = Mock.mock({
|
2018-03-23 10:34:52 +08:00
|
|
|
'list|4-10': [{
|
|
|
|
|
'id|+1': 1,
|
|
|
|
|
'name': '@CNAME',
|
2018-03-23 11:00:48 +08:00
|
|
|
'address1': '@CITY',
|
|
|
|
|
'address2': '@CITY'
|
2018-03-23 10:34:52 +08:00
|
|
|
}]
|
2018-03-23 11:00:48 +08:00
|
|
|
}).list
|
2018-03-23 10:34:52 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|