tjdud0123 / vue_note

Vue.js 코드 메모
6 stars 2 forks source link

ref 잡아올때 안잡혀오는 문제 #1

Open tjdud0123 opened 4 years ago

tjdud0123 commented 4 years ago
<flipbook ref="flipbook" class="flipbook" :pages="arrayImages" :zooms="[1]">
      <button @click="flipLeft">Previous Page</button>
      <button @click="flipRight">Next Page</button>
</flipbook>
<!--잡아오기 실패-->
console.log(this.$refs, this.$refs.flipbook, this.$refs['flipbook'])

setTimeout(() => {
      console.log(this.$refs, this.$refs.flipbook, this.$refs['flipbook'])
    }, 2000)

  flipLeft(){
      this.$refs?.flipbook?.flipLeft();
    },
    flipRight(){
      this.$refs?.flipbook?.flipRight();
    }