| | |
| | | :showPageList="loadPageList" |
| | | :interfaceQuestion="questionDataMap" |
| | | ></chapterFive> --> |
| | | |
| | | </div> |
| | | <translateWord :pageX="pageX" :pageY="pageY" :showWord="showWord" v-if="showWord" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import translateWord from "@/components/translateWord/index.vue"; |
| | | import pageHeader from "./header.vue"; |
| | | import chapterOne from "./chapter001.vue"; |
| | | // import chapterTwo from "./chapter002.vue"; |
| | |
| | | audioPath: "", |
| | | currentTime: null, |
| | | videoList: [], |
| | | pageX:0, |
| | | pageY:0, |
| | | showWord:"", |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | this.initViewer(); |
| | | this.closeAudio(); |
| | | this.closeVideo(); |
| | | this.handleTanslateWord() |
| | | }, 200); |
| | | }, |
| | | }, |
| | |
| | | dom.style.fontSize = fs + "px"; |
| | | } |
| | | }, |
| | | handleTanslateWord() { |
| | | const doms = ( |
| | | this.container ? this.container : document |
| | | ).querySelectorAll(".ts-word"); |
| | | for(let index = 0;index < doms.length;index++){ |
| | | const dom = doms[index]; |
| | | dom.onmouseenter = (event) => { |
| | | this.pageX = event.pageX; |
| | | this.pageY = event.pageY; |
| | | this.showWord = event.target.innerText; |
| | | console.log(event.target.innerText); |
| | | }; |
| | | dom.onmouseleave = () => { |
| | | this.showWord = "" |
| | | }; |
| | | } |
| | | } |
| | | }, |
| | | components: { |
| | | translateWord, |
| | | pageHeader, |
| | | chapterOne, |
| | | // chapterTwo, |
| | |
| | | |
| | | <style lang="less" scoped> |
| | | .page-main { |
| | | |
| | | |
| | | .page-content { |
| | | max-width: 816px; |
| | | min-width: 375px; |