web之家  
css

.viewer-toolbar ul{
display: inline-flex;
}

html
<ul id="files" style="display: none">
<template v-for="file in files">
<li><img :src="'../../sgccFiles/'+file.thumbnail" :data-original="'../../sgccFiles/'+file.file_name"></li>
</template>
</ul>

js

var vm = new Vue({
el: '#files',
data: {
files:[]
}
});
var viewer=null;
$.post(baseURL,{ycsb_id:ycsb_id},function (data) {
vm.files=data.files;
vm.$nextTick(function () {
//$('#ycsbUl').viewer({url: 'data-original'});
//$('#ycsbUl').viewer(0);
if(viewer!=null&&viewer!=undefined){
viewer.destroy();
}
var galley = document.getElementById('files');
viewer = new Viewer(galley, {
url: 'data-original',
title: "",
zoomable: true,
movable: true,
backdrop: true,
zoomRatio: 0.4, //鼠标滚动时的缩放比例
tooltip: true,
toolbar: true,
fullscreen: false,
button: true,
});
//debugger;
viewer.view();
});
});


posted on 2020-12-14 15:32  路修远而求索  阅读(910)  评论(0编辑  收藏  举报