Commit afdd45e1 authored by cinwell.li's avatar cinwell.li Committed by GitHub

Merge pull request #3384 from Leopoldthecoder/dev

update upload doc and add arrow click sorting for table
parents 249f04d5 e4fe2684
......@@ -351,7 +351,7 @@ data | additions options of request | object | — | —
name | key name for uploaded file | string | — | file
with-credentials | whether cookies are sent | boolean | — |false
show-upload-list | whether to show the uploaded file list | boolean | — | true
type | type of Upload | string | select/drag | select
drag | whether to activate drag and drop mode | boolean | — | false
accept | accepted [file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept), will not work when `thumbnail-mode` is `true` | string | — | —
on-preview | hook function when clicking the uploaded files | function(file) | — | —
on-remove | hook function when files are removed | function(file, fileList) | — | —
......
......@@ -401,7 +401,7 @@
| name | 可选参数, 上传的文件字段名 | string | — | file |
| with-credentials | 支持发送 cookie 凭证信息 | boolean | — | false |
| show-file-list | 是否显示已上传文件列表 | boolean | — | true |
| type | 上传控件类型 | string | select,drag | select |
| drag | 是否启用拖拽上传 | boolean | — | false |
| accept | 可选参数, 接受上传的[文件类型](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept)(thumbnail-mode 模式下此参数无效)| string | — | — |
| on-preview | 可选参数, 点击已上传的文件链接时的钩子, 可以通过 file.response 拿到服务端返回数据 | function(file) | — | — |
| on-remove | 可选参数, 文件列表移除文件时的钩子 | function(file, fileList) | — | — |
......
......@@ -111,8 +111,8 @@ export default {
{
column.sortable
? <span class="caret-wrapper" on-click={ ($event) => this.handleSortClick($event, column) }>
<i class="sort-caret ascending"></i>
<i class="sort-caret descending"></i>
<i class="sort-caret ascending" on-click={ ($event) => this.handleSortClick($event, column, 'ascending') }></i>
<i class="sort-caret descending" on-click={ ($event) => this.handleSortClick($event, column, 'descending') }></i>
</span>
: ''
}
......@@ -383,9 +383,9 @@ export default {
return !order ? 'ascending' : order === 'ascending' ? 'descending' : null;
},
handleSortClick(event, column) {
handleSortClick(event, column, givenOrder) {
event.stopPropagation();
let order = this.toggleOrder(column.order);
let order = givenOrder || this.toggleOrder(column.order);
let target = event.target;
while (target && target.tagName !== 'TH') {
......
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