Skip to content

Commit 04aa79b

Browse files
committed
update document
1 parent f114713 commit 04aa79b

File tree

8 files changed

+39
-14
lines changed

8 files changed

+39
-14
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,18 @@ plugins: [
128128
<td>10485760(10M)</td>
129129
<td>Limit the size of the file</td>
130130
</tr>
131+
<tr>
132+
<td>maxFileSize</td>
133+
<td align="left">Number</td>
134+
<td>10485760(10M)</td>
135+
<td>Limit the size of the file</td>
136+
</tr>
137+
<tr>
138+
<td>multipleSize</td>
139+
<td align="left">Number</td>
140+
<td>5</td>
141+
<td>Limit the count of the file</td>
142+
</tr>
131143
<tr>
132144
<td>maxWidth</td>
133145
<td align="left">Number</td>
@@ -176,5 +188,3 @@ plugins: [
176188
### Contributions
177189

178190
Your contributions and suggestions are welcome 😄😄😄💐💐💐.
179-
180-

dist/style/style.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
right: 0;
99
top:0;
1010
bottom:0;
11+
width: 100%;
12+
height: 100%;
13+
min-height: 61px;
1114
opacity: 0;
1215
}
1316
.g-core-image-upload-container{

dist/vue-core-image-upload.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="g-core-image-upload-btn" ref="container">
33
<slot>{{text}}</slot>
4-
<form class="g-core-image-upload-form" v-show="!hasImage" method="post" enctype="multipart/form-data" action="/api2/common_user/cropHeadUrl" style="display: block; cursor: pointer; position: absolute; left: 0px; top: 0px; width: 1242px; height: 61px; opacity: 0; margin: 0px; padding: 0px; overflow: hidden;">
4+
<form class="g-core-image-upload-form" v-show="!hasImage" method="post" enctype="multipart/form-data" action="" style="">
55
<input v-bind:disabled="uploading" v-bind:id="'g-core-upload-input-' + formID" v-bind:name="name" v-bind:multiple="multiple" type="file" v-bind:accept="inputAccept" v-on:change="change" v-on:dragover="dragover" v-on:dragenter="dragover" v-on:dragleave="dragleave" v-on:dragend="dragleave" v-on:drop="dragleave" style="width: 100%; height: 100%;">
66
</form>
77
<div class="g-core-image-corp-container" v-bind:id="'vciu-modal-' + formID" v-show="hasImage">
@@ -106,6 +106,11 @@
106106
return this.__dispatch('errorhandle','FILE IS TOO LARGER MAX FILE IS ' + formatSize);
107107
}
108108
109+
if (this.multipleSize > 0 && e.target.files.length > this.multipleSize) {
110+
console.warn('FILE NUM IS LARGER THAN ' + this.multipleSize);
111+
return this.__dispatch('errorhandle', 'FILE NUM OVERLOAD');
112+
}
113+
109114
this.files = e.target.files;
110115
if (this.crop || this.resize) {
111116
this.__showImage();

index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-core-image-upload",
3-
"version": "2.3.7",
3+
"version": "2.3.10",
44
"description": "a vue plgin for image upload and crop",
55
"main": "dist/vue-core-image-upload.vue",
66
"dependencies": {

site/client/components/doc/en/GetStarted.vue

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,17 @@ export default {
4545
</p>
4646
<div class="center">
4747
<vue-core-image-upload
48-
class="btn btn-primary"
49-
:crop="false"
50-
@imageuploaded="imageuploaded"
51-
:data="data"
52-
:max-file-size="5242880"
53-
url="http://101.198.151.190/api/upload.php" >
54-
</vue-core-image-upload>
48+
class="postImg"
49+
:crop="false"
50+
@imageuploaded="imageuploaded"
51+
@imageuploading="imageuploading"
52+
:data='data'
53+
inputOfFile="FeedBack"
54+
compress="50"
55+
:max-file-size="10485760"
56+
:credentials="false"
57+
url="https://v3.imacco.com/Upload/api/UploadImg" >
58+
</vue-core-image-upload>
5559
</div>
5660
<p>First of all , we need to include out plugin in <code>components</code> . Then we must define the <code>url</code> as your server api ,then we bind a function to
5761
<code>@imageuploaded</code> for handling the server response.

src/style/style.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
right: 0;
99
top:0;
1010
bottom:0;
11+
width: 100%;
12+
height: 100%;
13+
min-height: 61px;
1114
opacity: 0;
1215
}
1316
.g-core-image-upload-container{

src/vue-core-image-upload.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="g-core-image-upload-btn" ref="container">
33
<slot>{{text}}</slot>
4-
<form class="g-core-image-upload-form" v-show="!hasImage" method="post" enctype="multipart/form-data" action="/api2/common_user/cropHeadUrl" style="display: block; cursor: pointer; position: absolute; left: 0px; top: 0px; width: 1242px; height: 61px; opacity: 0; margin: 0px; padding: 0px; overflow: hidden;">
4+
<form class="g-core-image-upload-form" v-show="!hasImage" method="post" enctype="multipart/form-data" action="" style="">
55
<input v-bind:disabled="uploading" v-bind:id="'g-core-upload-input-' + formID" v-bind:name="name" v-bind:multiple="multiple" type="file" v-bind:accept="inputAccept" v-on:change="change" v-on:dragover="dragover" v-on:dragenter="dragover" v-on:dragleave="dragleave" v-on:dragend="dragleave" v-on:drop="dragleave" style="width: 100%; height: 100%;">
66
</form>
77
<div class="g-core-image-corp-container" v-bind:id="'vciu-modal-' + formID" v-show="hasImage">
@@ -105,7 +105,7 @@
105105
console.warn('FILE IS TOO LARGER MAX FILE IS ' + formatSize);
106106
return this.__dispatch('errorhandle','FILE IS TOO LARGER MAX FILE IS ' + formatSize);
107107
}
108-
108+
109109
if (this.multipleSize > 0 && e.target.files.length > this.multipleSize) {
110110
console.warn('FILE NUM IS LARGER THAN ' + this.multipleSize);
111111
return this.__dispatch('errorhandle', 'FILE NUM OVERLOAD');

0 commit comments

Comments
 (0)