웹개발2 210625 Javascript Textarea Input 이벤트에 맞춰 길이 늘리기 Javascript Textarea Input 이벤트에 맞춰 길이 늘리기 Vanilla Javascript const textarea = document.querySelector('textarea') textarea.addEventListener('input', e => { textarea.style.height = textarea.scrollHeight + 'px' }) Vue.js const textareaWrap = this.$refs.textarea.$el const textarea = textareaWrap.querySelector('textarea') textarea.style.height = 'auto' textarea.style.height = textarea.scrollHeight + '.. 2021. 11. 25. ES2021 새로운 문법 ES2021 Features ES2021 Features 논리 할당 연산자 - Logical Assignment Operators 숫자 분리 - Numeric Seperators Promise.any 와 AggregateError String.prototype.replaceAll WeakRefs 와 FinializationRegistry Objects 논리 할당 연산자 - Logical Assignment Operators // Or Or Equal x ||= y x || (x = y) // And And Equals x &&= y x && (x = y) // QQ Eqauls x ??= y x ?? (x = y) // 사용 예제 - 모두 동일한 구문입니다 if (!user.id) user.id = 1 .. 2021. 6. 28. 이전 1 다음