update README

master
git 8 years ago
parent 9429278b65
commit 9615613a4c

@ -264,7 +264,7 @@ const nodeExternals = require('webpack-node-externals');
* **Description:**
File List
**In order to prevent unpredictable errors, can not directly modify the `files`, please use` add`, `update`,` remove` method to modify**
**In order to prevent unpredictable errors, can not directly modify the `files`, please use [`add`](#add), [`update`](#update), [`remove`](#remove) method to modify**
* **[File object](#file)**
@ -322,7 +322,8 @@ const nodeExternals = require('webpack-node-externals');
* **Description:**
The `directory` attribute of the input tag
Whether it is a upload folder
[View supported browsers](http://caniuse.com/#feat=input-file-directory)
* **[View supported browsers](http://caniuse.com/#feat=input-file-directory)**
* **Usage:**
```html
@ -411,6 +412,8 @@ const nodeExternals = require('webpack-node-externals');
If set to `true`, read the parent component as a container
Required `html5` support
* **[View supported browsers](http://caniuse.com/#feat=dragndrop)**
* **Usage:**
```html
<file-upload :drop="true"></file-upload>
@ -553,7 +556,7 @@ const nodeExternals = require('webpack-node-externals');
* **Usage:**
```html
<file-upload ref="upload" :value="files" @input-file="inputFile"></file-upload>
<file-upload ref="upload" v-model="files" @input-file="inputFile"></file-upload>
```
```js
{
@ -576,6 +579,16 @@ const nodeExternals = require('webpack-node-externals');
if (newFile && oldFile) {
// Update file
// Start upload
if (newFile.active !== oldFile.active) {
console.log('Start upload', newFile.active, newFile)
// min size
if (newFile.size >= 0 && newFile.size < 100 * 1024) {
newFile = this.$refs.upload.update(newFile, {error: 'size'})
}
}
// Upload progress
if (newFile.progress !== oldFile.progress) {
console.log('progress', newFile.progress, newFile)
@ -855,7 +868,7 @@ const nodeExternals = require('webpack-node-externals');
## File
> **File object in the `input-filter` event outside the use of `$ refs.upload.update (file, data Object)`**
> **File object in the `input-filter` event outside the use of [`update`] (#update) method**
### id

@ -263,7 +263,7 @@ const nodeExternals = require('webpack-node-externals');
* **描述:**
文件列表
**为了防止不可预知的错误,不可直接修改 `files`,请使用 `add`, `update`, `remove` 方法修改**
**为了防止不可预知的错误,不可直接修改 `files`,请使用 [`add`](#add), [`update`](#update), [`remove`](#remove) 方法修改**
* **[文件对象信息](#file)**
@ -320,7 +320,8 @@ const nodeExternals = require('webpack-node-externals');
* **描述:**
文件表单的 `directory` 属性
是否是上传文件夹
[查看支持的浏览器](http://caniuse.com/#feat=input-file-directory)
* **[查看支持的浏览器](http://caniuse.com/#feat=input-file-directory) **
* **用法:**
```html
@ -409,6 +410,9 @@ const nodeExternals = require('webpack-node-externals');
如果设置成 `true` 则读取父组件作为容器
需要`HTML5`支持
* **[查看支持的浏览器](http://caniuse.com/#feat=dragndrop)**
* **用法:**
```html
<file-upload :drop="true"></file-upload>
@ -554,7 +558,7 @@ const nodeExternals = require('webpack-node-externals');
* **用法:**
```html
<file-upload ref="upload" :value="files" @input-file="inputFile"></file-upload>
<file-upload ref="upload" v-model="files" @input-file="inputFile"></file-upload>
```
```js
{
@ -577,6 +581,16 @@ const nodeExternals = require('webpack-node-externals');
if (newFile && oldFile) {
// 更新文件
// 开始上传
if (newFile.active !== oldFile.active) {
console.log('Start upload', newFile.active, newFile)
// 限定最小字节
if (newFile.size >= 0 && newFile.size < 100 * 1024) {
newFile = this.$refs.upload.update(newFile, {error: 'size'})
}
}
// 上传进度
if (newFile.progress !== oldFile.progress) {
console.log('progress', newFile.progress, newFile)
@ -856,7 +870,7 @@ const nodeExternals = require('webpack-node-externals');
## File
> **文件对象在`input-filter`事件外修改请使用 `$refs.upload.update(file, data Object)`**
> **文件对象在`input-filter`事件外修改请使用 [`update`](#update) 方法**
### id
* **类型:** `String | Number`

Loading…
Cancel
Save