| | |
| | | :showPageList="loadPageList" |
| | | :interfaceQuestion="questionDataMap" |
| | | ></chapterFive> --> |
| | | |
| | | </div> |
| | | <translateWord :pageX="pageX" :pageY="pageY" :showWord="showWord" v-if="showWord" /> |
| | | <translateWord |
| | | :pageX="pageX" |
| | | :pageY="pageY" |
| | | :showWord="showWord" |
| | | v-if="showWord" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | audioPath: "", |
| | | currentTime: null, |
| | | videoList: [], |
| | | pageX:0, |
| | | pageY:0, |
| | | showWord:"", |
| | | pageX: 0, |
| | | pageY: 0, |
| | | showWord: "", |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | this.initViewer(); |
| | | this.closeAudio(); |
| | | this.closeVideo(); |
| | | this.handleTanslateWord() |
| | | this.handleTanslateWord(); |
| | | }, 200); |
| | | }, |
| | | }, |
| | |
| | | const doms = ( |
| | | this.container ? this.container : document |
| | | ).querySelectorAll(".ts-word"); |
| | | for(let index = 0;index < doms.length;index++){ |
| | | 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); |
| | | if (this.showWord != event.target.innerText) { |
| | | const rect = dom.getBoundingClientRect(); |
| | | this.pageX = event.pageX - rect.width; |
| | | this.pageY = event.pageY + 20; |
| | | this.showWord = event.target.innerText; |
| | | console.log(event); |
| | | } |
| | | }; |
| | | dom.onmouseleave = () => { |
| | | this.showWord = "" |
| | | dom.onmouseleave = (event) => { |
| | | if(this.showWord == event.target.innerText) { |
| | | this.showWord = ""; |
| | | } |
| | | }; |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | components: { |
| | | translateWord, |