Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ant-design-pro-vue
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tianzhuanghu
ant-design-pro-vue
Commits
87045e97
Commit
87045e97
authored
Nov 26, 2018
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: Update doc
parent
d7ecca44
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
11 deletions
+16
-11
README.md
README.md
+1
-1
README.md
src/components/table/README.md
+15
-10
No files found.
README.md
View file @
87045e97
...
...
@@ -10,7 +10,7 @@ Overview
[
预览地址
](
https://pro.loacg.com/
)
**附带一些后台基础用到的列表展示例子**



...
...
src/components/table/README.md
View file @
87045e97
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment