nhn / toast-ui.vue-image-editor

Toast UI Image Editor for Vue
MIT License
187 stars 41 forks source link

fix: Remove 'editorInstance' from 'data' for memory issue #19

Closed junghwan-park closed 4 years ago

junghwan-park commented 4 years ago

Please check if the PR fulfills these requirements

Description

Remove editorInstance from data() {} for memory issue.


Thank you for your contribution to TOAST UI product. πŸŽ‰ 😘 ✨

jinwoo-kim-nhn commented 4 years ago

μˆ˜κ³ ν•˜μ…¨μŠ΅λ‹ˆλ‹€.

js87zz commented 4 years ago

이번 μˆ˜μ •μ‚¬ν•­μ€ μ•„λ‹ˆκΈ΄ ν•œλŒ€, 이 뢀뢄도 λ³€κ²½ν•˜λ©΄ 쒋을 것 κ°™μ•„μš”. ν˜„μž¬ λͺ¨λ“  μ΄λ²€νŠΈλ“€μ— λŒ€ν•΄μ„œ 무쑰건 이벀트 λ¦¬μŠ€λ„ˆλ₯Ό λ“±λ‘ν•˜κ³  μžˆλŠ”λ°, 이벀트 λ¦¬μŠ€λ„ˆκ°€ props둜 λ„˜μ–΄μ˜€λŠ” κ²ƒλ§Œ κ±Έμ–΄μ€˜μ•Όλ  것 κ°™μ•„μš”.

addEventListener() {
   editorEvents.forEach(eventName => {
      this.editorInstance.on(eventName, (...args) => this.$emit(eventName, ...args));
  });
  // μˆ˜μ • ν›„
  Object.keys(this.$listeners).forEach(eventName => {
     this.editorInstance.on(eventName, (...args) => this.$emit(eventName, ...args));
  }
}
junghwan-park commented 4 years ago

@js87zz @dongsik-yoo μ½”λ“œ 리뷰 λ°˜μ˜ν–ˆμŠ΅λ‹ˆλ‹€. 확인 λΆ€νƒλ“œλ¦½λ‹ˆλ‹€~!

dongsik-yoo commented 4 years ago

리뷰 μ™„λ£Œμž…λ‹ˆλ‹€.별닀λ₯Έ 의견 μ—†μŠ΅λ‹ˆλ‹€.

js87zz commented 4 years ago

이견 μ—†μŠ΅λ‹ˆλ‹€. 리뷰 μ™„λ£Œμž…λ‹ˆλ‹€!