---
title: "Michael Luo (@Michael0520) | Hashnode"
description: "Michael Luo (@Michael0520) writes on Hashnode. Read their latest articles and follow their work."
url: "https://hashnode.com/@Michael0520"
---

@Michael0520

# Michael Luo

@Michael0520 · Joined September 2022

### [Vue3-06-props&emit 元件的溝通傳遞](https://michael0520-blog.hashnode.dev/vue3-06-propsandemit-yuan?utm_source=hashnode&utm_medium=feed)

元件的溝通傳遞 Vue.js 每個元件的實體狀態、模板等作用範圍都應該要是獨立的， 也就是我們不能（也不應該）在子元件的模組「直接」去修改父元件，甚至是另一個元件的資料，因為元件化就是為了能夠重複使用，希望這些元件可以根據『外部＆內部』資料的改變，來呈現出不同的結果， 如果需要透過父層來傳遞資料給子層的話，就是 props 如果需要透過子層來傳遞資料給父層的話，就是 emit !\[props&emit 傳遞流程\](https://d1dwq032kyr03c.cloudfront.net/u...

2 min read · [michael0520-blog.hashnode.dev](https://michael0520-blog.hashnode.dev/vue3-06-propsandemit-yuan?utm_source=hashnode&utm_medium=feed)

[Aug 18, 2022](https://hashnode.com/posts/vue3-06-propsandemit-yuan/63359d34fa20fa4bc8e539ed)

### [Watch 的情境使用](https://michael0520-blog.hashnode.dev/watch?utm_source=hashnode&utm_medium=feed)

watch 總共有三個參數 val : 第一個為 被監聽的變數 newVal : 當監聽數值變化時，產生的新數值 oldVal : 當監聽數值變化時，產生的舊數值 watch(val, (newVal, oldVal) => { console.log(\`new: ${newVal} ; old: ${oldVal}\`); }); ref & reactive watch 監控差異 下方範例測試簡單的 ref watch 範例來執行： const { ref, reactive, ...

3 min read · [michael0520-blog.hashnode.dev](https://michael0520-blog.hashnode.dev/watch?utm_source=hashnode&utm_medium=feed)

[Aug 13, 2022](https://hashnode.com/posts/watch/63359ceefa20fa4bc8e539d1)

### [JavaScript - Macrotask 與 MicroTask 差異以及情境使用](https://michael0520-blog.hashnode.dev/javascript-macrotask-microtask?utm_source=hashnode&utm_medium=feed)

提到 Macrotask 與 MicroTask 之前，先再次複習 Promise 的觀念： 一個 Promise 最終會有兩種狀態 對應 Promise 的不同狀態，會各自觸發 .then 與 .catch 兩個函式 利用 Promise 可以達成非同步行為，而且內容可以自訂 Macrotasks 關於 Event Queue 有些 Web API 是具有非同步的行為，而在非同步的目的達成之後，瀏覽器會把給定的對應的函式推送到 Event Queue 裡面，這些一個一個函式正好代表每一件要...

2 min read · [michael0520-blog.hashnode.dev](https://michael0520-blog.hashnode.dev/javascript-macrotask-microtask?utm_source=hashnode&utm_medium=feed)

[Aug 6, 2022](https://hashnode.com/posts/javascript-macrotask-microtask/63359fb9e594fa4ba3b8c4b3)

### [React Hook - useEffect](https://michael0520-blog.hashnode.dev/react-hook-useeffect?utm_source=hashnode&utm_medium=feed)

React Hook - useEffect useEffect useEffect 讓你可以使用 function component 中的 side effect，side effect 包含資料 fetch 或手動改變 React component 中的 DOM。 因此當每次更新時，在 useEffect 中沒有設定相依參數，將會持續被執行。 :::tip Effect 重點 任何會產生 side Effect 的行為都應該 Effect Hook 裡執行。 他和 componentDi...

2 min read · [michael0520-blog.hashnode.dev](https://michael0520-blog.hashnode.dev/react-hook-useeffect?utm_source=hashnode&utm_medium=feed)

[Aug 6, 2022](https://hashnode.com/posts/react-hook-useeffect/6335a06fe594fa4ba3b8c4d0)

### [JavaScript - Event-Loop](https://michael0520-blog.hashnode.dev/javascript-event-loop?utm_source=hashnode&utm_medium=feed)

這次在練習一些前端常見的面試提時，遇到了一個有關 Event Loop 的題目問題，實在不是很暸解確切的執行過程，因此記錄一下學習筆記。 JavaScript - Event-Loop 關於 Event-Loop 在瀏覽器執行時的優點有兩項： Event Loop 協助了非同步請求的實現，並產生連貫的畫面呈現（influent UI）。 !\[同步請求(Synchronous) v.s. 非同步請求(Asynchronous) (from: Alpha Camp)\](https://miro.m...

2 min read · [michael0520-blog.hashnode.dev](https://michael0520-blog.hashnode.dev/javascript-event-loop?utm_source=hashnode&utm_medium=feed)

[Aug 5, 2022](https://hashnode.com/posts/javascript-event-loop/63359d11fa20fa4bc8e539e7)
