原创 Traps in reduce

Optional initialValue? Sometimes, we can see code using reduce without initialValue. For example, const array = [1, 2, 3

原创 TCP Connection Reuse on HTTP/1.1 and 2.0

I saw the introduction of http/2.0 in developers.google.com. However, I feel confused about the request and response mul

原创 Tricks in Vue

There are some tricks which can't be found easily in Vue.js homepage. So, for convenient, I summarized them here. Vue Ac

原创 酷狗音樂- Vue / React 全家桶的兩種實現

引言 兩個月前用 Vue 全家桶實現過一次 酷狗音樂,最近又用 React 全家桶重構了下,最終成果和 Vue的實現基本一致,放個圖: 手機預覽戳 Vue 版本, React 版本。 demo 選擇 本來想用 React 全家桶重新選個項

原创 promise, async, await, execution order

async can be transformed to promise. So, if we want to understand async, we have to understand promise first. Promise No

原创 Serval Ways to Force Update in Vue

I have to mention this before we go on. As the doc-Forcing-an-Update says: If you find yourself needing to force an upda

原创 更簡單的理解 apply , call

The first time I know apply was when I met this code: Math.max.apply(null, [1, 2, 3, 4]) As the mdn said, The apply() me

原创 chrome:移動端中的 100vh 始終等於地址欄隱藏時的高度

The first time when I know vh I was very excited. Finally, we can do this by css instead of js. However, still too naive

原创 Vue 中 Computed 的陷阱

If you have used vue I guess you probably know or have used computed. It seems pretty convenient and easy to use. Howeve

原创 audio 自動播放被禁止的處理措施

If you have used audio or video, I guess you probably know autoplay attribute. Sometimes, PM wants to use that. However,

原创 一個案例理解 vue 中的 .sync 修飾符

Preface The first time I met .sync modifier, I didn't know it very well. So, I seldom use that. Today, I am going to get

原创 onorientationchange 事件的兼容性處理

Preface When I was using orientationchange event, I met a few bugs. So, I take it down. Main compatibility problem When

原创 自定義微信分享樣式

博客地址 Preface 產品希望我們在微信分享出去的鏈接,有自己的樣式,而不是僅僅一個鏈接。用產品的話來說,你發給客戶一個鏈接,客戶敢點麼??? 聽着比較有意思,不過也不能說完全沒有道理,畢竟各種各樣的詐騙大家也是有所耳聞,經確認,產品想

原创 使用 qrcodejs 生成二維碼的幾個問題

博客地址 Preface 產品希望我這邊下載頁面加個二維碼,可以掃描下載 APP,並且希望二維碼中有公司的 logo,很合理的需求,不過實現的時候依舊遇到了幾個問題,在此記錄下。 Main 二維碼的實現邏輯我當然沒有這個時間去研究,直接用的

原创 vue 表單輸入綁定,有時不會自動更新?

Blog Address Preface When I was using form validate in Vue, I found sometimes vue doesn't render data which was modified