<script>// EbookSettingProgress.vue中js代码
import { ebookMixin } from '../../utils/mixin'
export default {
mixins: [ebookMixin],
methods: {
onProgressChange (progress) {
this.setProgress(progress).then(() => {
this.displayProgress()
this.updateProgressBg()
})
},
onProgressInput (progress) {
this.setProgress(progress).then(() => {
this.updateProgressBg()
})
},
displayProgress () {
const cfi = this.currentBook.location.cfiFromPercentage(this.progress / 100)
this.currentBook.rendition.display(cfi)
},
updateProgressBg () {
this.$refs.progress.style.backgroundSize = `${this.progress}% 100%`
},
prevSection () {},
nextSection () {}
},
updated () {
this.updateProgressBg()
}
}
</script>