亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Vuejs jasnyBoostrap 上載 多張圖片的預覽效果

發布時間:2020-07-31 03:08:07 來源:網絡 閱讀:1902 作者:whaoran4726 欄目:開發技術

原版 jasnybootstrap無法進行多張圖片上傳后的預覽,所以借鑒了一些別的方法。


HTML

<v-form class="manage-file" id="manage-file" ref="form">

            <input type="hidden" name="pubprojectid" :value="project.id"></input>

            <div class="form-group">

                <label class="col-xs-3 control-label">項目圖片</label>

                <div class="col-xs-8">

                    <div class="fileinput fileinput-new" data-provides="fileinput">

                        <div>

                            <span class="btn btn-default btn-file">

                            <span class="fileinput-new">選擇文件</span>

                            <span class="fileinput-exists">修改文件</span>

                            <input type="file" multiple name="files" @change="filesChange">

                            </span>

                            <a @click="delFiles" class="btn btn-default fileinput-exists" data-dismiss="fileinput">刪除文件</a>

                        </div>

                    </div>

                    <div class="col-xs-12 padding-0">

                        <div class="fileinput" data-provides="fileinput" v-for="(fileItem, index) in files" style="margin-right: 5px; width: 150px;">

                            <div class="fileinput-new thumbnail" style="width: 150px;">

                                <div class="file" style="width: 100%; margin-bottom: 0;">

                                    <a>

                                    <span class="corner"></span>

                                    <div>

                                        <img :src="picSrc[index]" style="height:120px"></img>

                                    </div>

                                    </a>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </v-form>


Vue代碼:

//files 和 imgsrc分開,就可以了

            for (let i = 0; i < e.target.files.length; i++) {

                let picture = e.target.files[i];

                if (picture) {

                    var reader = new FileReader();

                    reader.readAsDataURL(picture);

                    reader.onload = e =>{

                        this.picSrc.push(e.target.result);

                    };

                } else {

                    swal({

                    title: '請選擇上傳圖片',

                    confirmButtonText: '確定',

                    confirmButtonColor: '#294988',

                    type: 'error',

                    });

                }

                picture.uploadDate = new Date();

                this.files.push({pic: picture});

            }


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

甘肃省| 佛坪县| 朔州市| 嵩明县| 连南| 凌云县| 安塞县| 河源市| 佛坪县| 石渠县| 许昌市| 永安市| 临江市| 泸溪县| 武夷山市| 景谷| 西峡县| 普兰县| 西丰县| 高碑店市| 永顺县| 多伦县| 商丘市| 丰镇市| 夏河县| 临沂市| 读书| 禄丰县| 铜鼓县| 顺平县| 达尔| 定兴县| 石门县| 苍南县| 岐山县| 滁州市| 扶余县| 汶上县| 静安区| 新郑市| 定远县|