Bladeren bron

update upload doc and add arrow click sorting for table

Leopoldthecoder 8 jaren geleden
bovenliggende
commit
e4fe26840f
3 gewijzigde bestanden met toevoegingen van 6 en 6 verwijderingen
  1. 1 1
      examples/docs/en-US/upload.md
  2. 1 1
      examples/docs/zh-CN/upload.md
  3. 4 4
      packages/table/src/table-header.js

+ 1 - 1
examples/docs/en-US/upload.md

@@ -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) | — | —

+ 1 - 1
examples/docs/zh-CN/upload.md

@@ -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) | — | — |

+ 4 - 4
packages/table/src/table-header.js

@@ -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') {