no message

Former-commit-id: f3c11b2f64cc627044be20129050e193a8eec631
Former-commit-id: 49657d956a264020cda5ee3230870cf736197400
Former-commit-id: c3796afffe32e911c917133f2dc804cfe664acd7
This commit is contained in:
liyang
2018-06-06 22:42:53 +08:00
parent 64f1a1f9a4
commit 51c2260e8f
18 changed files with 4 additions and 36 deletions

View File

@@ -0,0 +1,46 @@
<template>
<Container type="ghost">
<el-card>
<div slot="header">
<el-button @click="ajax">发送请求</el-button>
</div>
<el-table v-bind="table" style="width: 100%" class="dd-mb">
<el-table-column
v-for="(item, index) in table.columns"
:key="index"
:prop="item.prop"
:label="item.label">
</el-table-column>
</el-table>
<Markdown url="/static/md/插件 - mock拦截ajax.md"></Markdown>
</el-card>
</Container>
</template>
<script>
export default {
data () {
return {
table: {
columns: [],
data: [],
size: 'mini',
stripe: true,
border: true
}
}
},
methods: {
ajax () {
this.$axios.get('/api/ajax-demo')
.then(res => {
this.table.columns = Object.keys(res.list[0]).map(e => ({
label: e,
prop: e
}))
this.table.data = res.list
})
}
}
}
</script>