Vue Study
๐ ๋ชฉ์ฐจ Introduction What is teleport? Usage Conclusion Reference ๐ Introduction ์๋
ํ์ธ์. ์ด๋ฒ์๋ teleport์ ๋ํด์ ์์๋ณด๊ฒ ์ต๋๋ค. ํด๋น ์ฝ๋๋ ์ฌ๊ธฐ์ ํ์ธํ ์ ์์ต๋๋ค. ๐ What is teleport? teleport๋ vue2์์ vue-teleport์ ๋๊ฐ์ต๋๋ค. ๋ฌธ์์์๋ ์ฃผ๋ก modal์ ์ฌ์ฉํ ๋ ์ด๋ค๊ณ ํ๋ค์. to๋ฅผ ์ด์ฉํด์ ๋ณด๋ผ์ ์๋๋ฐ ๊ทธ๋ฅ ์ผ๋ฐ์ ์ธ string์ผ๋ก๋ ์ฌ์ฉํ์ง ์์ต๋๋ค. ์์ด๋๋ ํด๋์ค๋ฅผ ์ฌ์ฉํด์ ์ฌ์ฉํ๋ผ๊ณ ํ๋ค์. ๋น์ฐํ ์๊ธฐ์ง๋ง ์ํ๋ ๊ณณ์ผ๋ก ์ ๋๋ก ๋ณด๋ผ์ ์์ด์ผ ํ๊ธฐ ๋๋ฌธ์
๋๋ค. ๐ Usage // App.js MyDiv01 MyDiv02 ์ด์ div(#teleport)์์ผ๋ก ๋ค์ด๊ฐ์ง๋๋ค. ..
Vue Study
๐ ๋ชฉ์ฐจ Introduction What is Provide/Inject? Usage Reactice Usage Conclusion Reference ๐ Introduction ์๋
ํ์ธ์. ์ด๋ฒ ํฌ์คํ
์์๋ ์๋ก์ด provide/inject์ ๋ํด์ ์์๋ณด๊ฒ ์ต๋๋ค. ํด๋น ์ฝ๋๋ ์ฌ๊ธฐ์๋ณผ์ ์์ต๋๋ค. ๐ What is Provide/Inject? ๋ง์ฝ ์ด๋ฐ ์ํฉ์ด๋ผ๊ณ ๊ฐ์ ํด๋ณผ๊ฒ์. ์์์ ๋ถ๋ชจ์์ ๋ฌผ๋ก props๋ก ์ ๋ฌ์ด ๊ฐ๋ฅํ๊ฒ ์ง๋ง ์ข๋ ๊น๋ํ ๋ฐฉ๋ฒ์ผ๋ก ํ๋ฒ์ ์ ๋ฌํ ์ ์์๊น์? ๋ค ๊ทธ๊ฒ provide/inject์
๋๋ค. ๐ ๐ Basic Usage ์ปดํฌ๋ํธ ๊ตฌ์กฐ ์
๋๋ค. |_App -> provide โญ๏ธ |_MyDiv1 |_MyDiv2 |_MyDiv3 |_InjectedPractice -> inje..
Vue Study
๐ ๋ชฉ์ฐจ Introduction Life cycle in vue Hook inside setup Conclusion Reference ๐ Introduction ์๋
ํ์ธ์. ์ค๋์ Vue3์ ์๋ก์ด life cycle์ ๋ํด์ ์์๋ณด๋ ค๊ณ ํฉ๋๋ค. ํด๋น ์ฝ๋๋ ์ฌ๊ธฐ์ ํ์ธํ ์ ์์ต๋๋ค. ๐ Hook inside setup ๋จผ์ ์๋กญ๊ฒ ๋ฐ๋ ๊ฒ๋ค์ ๋ํด์ Vue3 ๊ณต์ ๋ฌธ์์ ์์ธํ๊ฒ ๋์์์ต๋๋ค. ๋ค ์ด์ beforeCreated๋ created๋ ๊ตณ์ด ์ ์ธ์ ํ ํ์๊ฐ ์์ด ์ก์ต๋๋ค. import { onMounted, nextTick, onUpdated } from 'vue'; export default { name: 'App', components: { HelloWorld }, setup() { co..
Vue Study
๐ ๋ชฉ์ฐจ Introduction computed watchEffect watch Conclusion Reference ๐ Introduction ์๋
ํ์ธ์. ์ด๋ฒ ํฌ์คํ
์์๋ computed์ watch์ ๋ํด ์์๋ณด๊ฒ ์ต๋๋ค. ํด๋น ์ฝ๋๋ ์ฌ๊ธฐ์ํ์ธํ ์ ์์ต๋๋ค. ๐ computed computed๋ ๊ธฐ์กด vue 2์์์ computed์ ๊ฐ์ต๋๋ค. ๋ค๋ฅธ ์ ์ immutable ref object๋ฅผ ๋ฐํํฉ๋๋ค. import { ref, computed } from 'vue'; export default { setup() { const count = ref(1); const plusOne = computed(() => count.value + 1); const onClick = () => ..
Vue Study
๐ ๋ชฉ์ฐจ Introduction ref unref toRef toRefs isRef customRef shallowRef triggerRef Conclusion Reference ๐ Introduction ์๋
ํ์ธ์. ์ด๋ฒ ํฌ์คํ
์ vue3์ refs์ ๋ํด ์์๋ณด๊ฒ ์ต๋๋ค. ํด๋น ์ฝ๋๋ ์ฌ๊ธฐ์ํ์ธ ํ์ค์ ์์ต๋๋ค. ๐ ref ref inner value๋ก reactiveํ๊ณ mutableํ ๊ฐ์ฒด๋ฅผ ๋ฐํํฉ๋๋ค. ref ๊ฐ์ฒด๋ value property๋ฅผ ๊ฐ์ง๊ณ ์์ต๋๋ค. import { ref } from 'vue'; export default { setup() { const count = ref(0); const onClick = () => { console.log(count); // { ..
Vue Study
๐ ๋ชฉ์ฐจ Introduction reactive readonly isProxy isReactive isReadonly toRaw markRaw shallowReactive shallowReadonly Conclusion Reference ๐ Introduction ์๋
ํ์ธ์. ์ค๋์ vue3์ ์๋ก์ด reactive apis์ ๋ํด ์์๋ณด๊ฒ ์ต๋๋ค. ํด๋น ์ฝ๋๋ ์ฌ๊ธฐ์ ํ์ธํ ์ ์์ต๋๋ค.๐ ๐ reactive reactive๋ deep-copy๋ object๋ฅผ ๋ฐํํฉ๋๋ค. import { reactive } from 'vue'; export default { name: 'App', setup() { const obj = reactive({ count: 0 }); const c..
Javascript Study
๐ ๋ชฉ์ฐจ Introduction What is proxy? Basic Example of Proxy Conclusion Reference ๐ Introduction ์๋
ํ์ธ์. ์ด๋ฒ์ Vue3 ๊ณต๋ถ์ ๋๋ง์ ํ๋ ์์ํฌ ๋ง๋ค๊ธฐ์์ ๋์จ Proxy๋ผ๋ ๊ฐ๋
์ด ์์ํ์ฌ ๊ฐ๋
์ ์ ๋ฆฌํ ๊ธ์
๋๋ค. ๐ What is proxy? Proxy๊ฐ์ฒด๋ ์๋ฐ์คํฌ๋ฆฝํธ์์์ ๊ธฐ๋ณธ ์์
์ ๋ํ ํ์์ ๋ํด ์ฌ์ฉ์ ์ปค์คํ
๋์์ ์ ์ํ ๋ ์ฌ์ฉํฉ๋๋ค. ๊ธฐ๋ณธ์ ์ธ Proxy ์ฌ์ฉ: new Proxy(target, handler); target์ Proxy๋ก ๋ฉํํ ๋์ ๊ฐ์ฒด๋ฅผ ์ง์ ํด์ฃผ๊ณ handler๋ Proxy์ ๋์์ ์ ์ํ๋ ํจ์ ๊ฐ์ฒด๋ฅผ ๋ฃ์ด์ค๋๋ค. ๐ Basic Example of Proxy ๋ง์ฝ ํธ๋ค๋ฌ๋ฅผ ์ง์ ์ ํด์ฃผ์ง ์๋๋ค..
Design Pattern
๐ ๋ชฉ์ฐจ Introduction What's Mediator Pattern? Implementation Conclusion Reference ๐ Introduction ์๋
ํ์ธ์. ์ด๋ฒ ํฌ์คํ
์์๋ ์ค์ฌ์ ํจํด์ ๋ํด ๋ฐฐ์๋ณด๊ฒ ์ต๋๋ค. ๐ What's Mediator Pattern? ์ค์ฌ์ ํจํด์ผ๋ก Messenger Class๋ฅผ ๊ตฌํ ํด๋ณผ ํ
๋ฐ์. ์ค์ฌ์ ํจํด์ ๋ค์ ๋ํ๊ณผ ๊ฐ์ต๋๋ค. Message๋ฅผ ๊ฐ๊ฐ์ participants์๊ฒ ๋ฟ๋ ค์ฃผ๊ฒ ๋ฉ๋๋ค. ์ฌ๊ธฐ์์ ์ผ๋จ ๋๋ช
๋ง ๋ฑ๋ก์ ํ๋ ๊ฒ์ผ๋ก ๊ฐ์ ์ ํ๊ณ ์ด๋ป๊ฒ ๊ตฌํ์ด ๋๋์ง๋ฅผ ๋ณด์ฌ๋๋ฆฌ๊ณ์ต๋๋ค. ๐ Implementation ์ผ๋จ ์ค์ฌ์ ํจํด์ผ๋ก ์ด Messenger๋ ์ด๋ ๊ฒ ์๊ฒผ์ต๋๋ค. class Messenger { constructor(..