Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
485 views
in Technique[技术] by (71.8m points)

epubjs每个主题颜色一页只能更换一次,需要翻页才能换下一次

初始化主题是没问题的,会显示出来,我通过themes.register注册了四个样式,但是四个样式一页只能换一次,四个样式都换过以后,需要翻页后才能themes.select才会更换样式 希望可以指导一下,万分感谢

初始化

themes.forEach(theme => {
   this.rendition.themes.register(theme.name, theme.style)
})
this.rendition.themes.select(defaultTheme)

点击更换

setTheme (index) {
      const name = this.themeList[index].name
      this.setDefaultTheme(name).then(() => {
        this.rendition.themes.select(this.defaultTheme)
      })
      setTheme(this.fileName, name)
    }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

用0.3.71版本


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...