Commit 87045e97 by Sendya

chore: Update doc

parent d7ecca44
......@@ -10,7 +10,7 @@ Overview
[预览地址](https://pro.loacg.com/) **附带一些后台基础用到的列表展示例子**
![工作台+设置菜单](https://static-2.loacg.com/open/static/github/2018-11-10_19-23-39.png)
![工作台+设置菜单](https://static-2.loacg.com/open/static/github/20181126112124.png)
![工作台](https://static-2.loacg.com/open/static/github/20180916-134306.png)
......
......@@ -16,9 +16,11 @@ Table 重封装组件说明
(基础使用)
```vue
<template>
<s-table
ref="table"
:rowKey="(record) => record.data.id"
size="default"
:columns="columns"
:data="loadData"
......@@ -28,11 +30,12 @@ Table 重封装组件说明
<script>
import STable from '@/components/table/'
export default {
components: {
STable
},
data () {
data() {
return {
columns: [
{
......@@ -71,7 +74,8 @@ Table 重封装组件说明
return res.result
})
},
},
}
}
}
</script>
......@@ -94,10 +98,10 @@ Table 重封装组件说明
>
<span slot="action" slot-scope="text, record">
<a>编辑</a>
<a-divider type="vertical" />
<a-divider type="vertical"/>
<a-dropdown>
<a class="ant-dropdown-link">
更多 <a-icon type="down" />
更多 <a-icon type="down"/>
</a>
<a-menu slot="overlay">
<a-menu-item>
......@@ -117,11 +121,12 @@ Table 重封装组件说明
<script>
import STable from '@/components/table/'
export default {
components: {
STable
},
data () {
data() {
return {
columns: [
{
......@@ -147,7 +152,7 @@ Table 重封装组件说明
{
table: '操作',
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
scopedSlots: {customRender: 'action'},
}
],
// 查询条件参数
......@@ -160,14 +165,14 @@ Table 重封装组件说明
return res.result
})
},
},
}
},
methods: {
edit (row) {
edit(row) {
// axios 发送数据到后端 修改数据成功后
// 调用 refresh() 重新加载列表数据
// 这里 setTimeout 模拟发起请求的网络延迟..
setTimeout (() => {
setTimeout(() => {
this.$refs.table.refresh()
}, 1500)
......@@ -213,7 +218,7 @@ result.then(r => {
!r.totalCount && ['auto', false].includes(this.showPagination) && (this.localPagination = false)
this.localDataSource = r.data; // 返回结果中的数组数据
this.localLoading = false
});
});
```
返回 JSON 例子:
```json
......
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