|
@@ -55,20 +55,25 @@ export default defineComponent({
|
|
|
setStepContent(step: number) {
|
|
|
this.audio.src = mp3s[`../mp3/${IDSteps[step]}.mp3`].default;
|
|
|
this.audio.play();
|
|
|
- console.log("🚀 ~ this.audio:", this.audio, this.audio.currentTime)
|
|
|
const originElement = document.getElementById("tips-step-" + IDSteps[step]);
|
|
|
+ const boxRef = document.getElementById('boxRef')
|
|
|
if (originElement?.style.display === 'none'){
|
|
|
this.$nextTick(() => {
|
|
|
this.next()
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
+ if (originElement && boxRef){
|
|
|
+ boxRef.innerHTML = ''
|
|
|
+ boxRef.appendChild(originElement.cloneNode(true))
|
|
|
+ }
|
|
|
const box: any = originElement?.getBoundingClientRect() || {};
|
|
|
+ const _fix = 6
|
|
|
this.box = {
|
|
|
- left: box.x + "px",
|
|
|
- top: box.y + "px",
|
|
|
- width: box.width + "px",
|
|
|
- height: box.height + "px",
|
|
|
+ left: box.x - _fix + "px",
|
|
|
+ top: box.y - _fix + "px",
|
|
|
+ width: box.width + _fix * 2 + "px",
|
|
|
+ height: box.height + _fix * 2 + "px",
|
|
|
};
|
|
|
},
|
|
|
next() {
|
|
@@ -83,7 +88,7 @@ export default defineComponent({
|
|
|
render() {
|
|
|
return (
|
|
|
<div>
|
|
|
- <div style={this.box} class={styles.box}></div>
|
|
|
+ <div id="boxRef" style={this.box} class={styles.box}></div>
|
|
|
<div class={styles.messagebox}>
|
|
|
{/* @ts-ignore */}
|
|
|
<span>{setpText[IDSteps[this.step]].desc}</span>
|