File tree Expand file tree Collapse file tree 3 files changed +75
-0
lines changed Expand file tree Collapse file tree 3 files changed +75
-0
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div class =" components" >
3
+ <h3 >Upload multiple files</h3 >
4
+ <p >Set <code >multiple</code > equal <code >true</code >, and you could select more than one file. And your server will recieved an array of files.</p >
5
+ <h4 >multiple-size</h4 >
6
+ <p ><code >multiple-size</code > is a number which limits your count of the files you selected.</p >
7
+ <h4 >演示</h4 >
8
+ <div class =" center" >
9
+ <vue-core-image-upload
10
+ :class =" ['btn', 'btn-primary']"
11
+ :crop =" false"
12
+ @imageuploaded =" imageUploded"
13
+ :max-file-size =" 5242880"
14
+ :multiple =" true"
15
+ :multiple-size =" 4"
16
+ url =" http://101.198.151.190/api/upload2.php" >
17
+ </vue-core-image-upload >
18
+ </div >
19
+ <table class =" m-table bordered" >
20
+ <thead >
21
+ <tr >
22
+ <th >File Name</th >
23
+ <th >File Size</th >
24
+ </tr >
25
+ </thead >
26
+ <tbody >
27
+ <tr v-for =" item in fileList" :key =" item.name" >
28
+ <td >{{item.name}}</td >
29
+ <td >{{item.size}}</td >
30
+ </tr >
31
+ </tbody >
32
+ </table >
33
+ <p >Click the button and you will see the file name and size above the table</p >
34
+ <h4 >Code Example</h4 >
35
+ <pre v-highlightjs ><code class =" javascript" >< ; vue-core-image-upload
36
+ :class="['btn', 'btn-primary']"
37
+ :crop="false"
38
+ @imageuploaded="imageUploded"
39
+ :max-file-size="5242880"
40
+ :multiple="true"
41
+ :multiple-size="4"
42
+ url="http://101.198.151.190/api/upload2.php" > ;
43
+ < ; /vue-core-image-upload> ; </code ></pre >
44
+ <a href =" " >View code source</a >
45
+ </div >
46
+ </template >
47
+
48
+ <script >
49
+ import VueCoreImageUpload from ' ../../../../src/vue-core-image-upload.vue'
50
+ export default {
51
+ components: {
52
+ VueCoreImageUpload,
53
+ },
54
+ data () {
55
+ return {
56
+ fileList: [],
57
+ }
58
+ },
59
+
60
+ methods: {
61
+ imageUploded (res ) {
62
+ if (res .errcode == 0 ) {
63
+ this .fileList = res .data ;
64
+ }
65
+ }
66
+ }
67
+
68
+ };
69
+
70
+ </script >
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import CnEvents from '../components/doc/cn/Events.vue';
10
10
import EnEvents from '../components/doc/en/Events.vue' ;
11
11
import CnCropImage from '../components/doc/cn/CropImage.vue' ;
12
12
import CnMultipleFile from '../components/doc/cn/MultipleFile.vue' ;
13
+ import EnMultipleFile from '../components/doc/en/MultipleFile.vue' ;
13
14
import CnCompressImage from '../components/doc/cn/CompressImage.vue' ;
14
15
import CnPostData from '../components/doc/cn/PostData.vue' ;
15
16
import EnPostData from '../components/doc/en/PostData.vue' ;
@@ -66,6 +67,10 @@ export default new Router({
66
67
path : '/cn/multiple-file' ,
67
68
component : CnMultipleFile
68
69
} ,
70
+ {
71
+ path : '/en/multiple-file' ,
72
+ component : EnMultipleFile
73
+ } ,
69
74
{
70
75
path : '/cn/compress-image' ,
71
76
component : CnCompressImage ,
You can’t perform that action at this time.
0 commit comments