如何用 Javascript format JSON
解決方法:
我們可以使用JSON.stringify 來 format
e.g.
var c = {a : "test", b:{ data: "asdada"}} JSON.stringify(c, null, 4) "{ "a": "test", "b": { "data": "asdada" } }" Hope you find it useful
最近有一個 task 係要做一些 code clean up…
發現有很多重覆既動作..
係時候用下腦記下 D Visual Studio Shortcut…
因為用 mouse 真係有 D 慢..
用 shortcut key 有時真係方便好多
Remove and Sort Using
Ctrl + R Ctrl + G
Comment the selected line
Ctrl K + Ctrl + C
Uncomment the selected line
Ctrl K + Ctrl + U
Build Solution
Ctrl + Shift + B
To be continue 不定時更新…
Hope you find it useful
使用 firebase hosting 來 host reactjs 既時候 出現了以下問題
當我直接在 browser 輸入 ReactJs 的 route 既時候 出現了
Page Not Found This file does not exist and there was no index.html found in the current directory or 404.html in the root directory 解決方法: 我們只需要在 firebase.json 的 hosting section 加上 rewrites 到 index.html 便可以了
{ "hosting": { "public": "build", "ignore": [ "firebase.json", "**/.*", "**/node_modules/**" ], "rewrites": [ { "source": "**", "destination": "/index.html" } ] } } Hope you find it useful