diff --git a/docs/docs/en.md b/docs/docs/en.md index a4e737f..f26e7b1 100644 --- a/docs/docs/en.md +++ b/docs/docs/en.md @@ -545,6 +545,25 @@ Whether to open the drag directory +### add-index + +* **Type:** `Boolean, Number` + +* **Default:** `undefined` + +* **Version:** : `>=2.6.1` + +* **Details:** + + The default value of the `index` parameter for the [`add()`](#instance-methods-add) method + +* **Usage:** + ```html + + ``` + + + ## Options / Events @@ -866,7 +885,7 @@ Add one or more files * **Arguments:** * `files: Array | File | window.File | Object` If it is an array of responses will be an array - * `start: Boolean` Whether it is inserted from the start position + * `index: Number | Boolean` = [`props.add-index`](#options-props-add-index) `true = ` Start, `false = ` End, `Number = ` Index * **Result:** `Object | Array | Boolean` The incoming array is returned to the array otherwise the object or `false` @@ -1013,6 +1032,17 @@ Remove a file object ``` +### replace() + Replace the location of the two files + +* **Arguments:** + + * `id1: File | Object | String` + * `id2: File | Object | String` + + +* **Result:** `Boolean` + ### clear() diff --git a/docs/docs/zh-cn.md b/docs/docs/zh-cn.md index 9f18e70..c6cbcb9 100644 --- a/docs/docs/zh-cn.md +++ b/docs/docs/zh-cn.md @@ -540,6 +540,23 @@ input标签的 `name` 属性 ``` +### add-index + +* **类型:** `Boolean, Number` + +* **默认值:** `undefined` + +* **详细:** + +* **版本:** `>= 2.6.1` + + [`add()`](#实例-方法-add) 方法 `index` 参数的默认值 + +* **示例:** + ```html + + ``` + ## 选项 / 事件 @@ -860,7 +877,7 @@ Add, update, remove pre-filter * **参数:** * `files: Array | File | window.File | Object` 如果它是一个数组的响应将是一个数组 - * `start: Boolean` 是否从开始位置插入 + * `index: Number | Boolean` = [`props.add-index`](#选项-属性-add-index) `true = ` 开始位置, `false = ` 结束位置, `Number = ` 下标位置 * **结果:** `Object | Array | Boolean` 传入的是数组返回数组否则对象或`false` @@ -1008,6 +1025,19 @@ Add, update, remove pre-filter ``` +### replace() + 替换两个文件的位置 + +* **参数:** + + * `id1: File | Object | String` + * `id2: File | Object | String` + + +* **结果:** `Boolean` + + + ### clear() 清空文件列表 diff --git a/docs/views/examples/Full.vue b/docs/views/examples/Full.vue index 3548ba4..82d6d16 100644 --- a/docs/views/examples/Full.vue +++ b/docs/views/examples/Full.vue @@ -97,6 +97,7 @@ :data="data" :drop="drop" :drop-directory="dropDirectory" + :add-index="addIndex" v-model="files" @input-filter="inputFilter" @input-file="inputFile" @@ -163,6 +164,14 @@ +
+
+ +
+ Add a file list to start the location to add +