跳目录进度条不会变化,找了好久没找到解决办法

来源:3-13 课程总结

再难也要坚持

2019-04-08 18:34

getCurProgress: function(type){
    var currentLocation = vm.rendition.currentLocation();
    if (type=='prev') {
        vm.progress = (Math.floor(vm.locations.percentageFromCfi(currentLocation.start.cfi)*10000)/100).toFixed(0);
    }
    if (type=='next') {
        vm.progress = (Math.floor(vm.locations.percentageFromCfi(currentLocation.start.cfi)*10000)/100).toFixed(0);
    }else {
        vm.progress = (Math.floor(vm.locations.percentageFromCfi(currentLocation.start.cfi)*10000)/100).toFixed(0);
    }
    this.$refs.progress.style.backgroundSize = `${vm.progress}% 100%`;
},


写回答 关注

1回答

  • qq_慕数据4544929
    2019-04-29 11:52:23

    就这一段看不出问题啊,你把相应的点击目录跳转和进度的html发一下看看问题在哪

快速入门Web阅读器开发

带你了解电子书阅读器的工作原理,通过Vue.js快速实现Web阅读器

26242 学习 · 214 问题

查看课程

相似问题