Commit 87045e97 by Sendya

chore: Update doc

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