
Lastor
coding 見鬼,在弄一個 create / edit 頁共用組件,edit 頁會有問題,大致上是我將 Vue 組件依賴的 props 設成 required,可是初始化的時候 Vue 回報說沒給值

Lastor
但我去打 console.log 或是從 Vue devtools 觀察,明明就都有值

Lastor
找了幾分鐘依舊不明所以,想說算了。默默的把 required 改成給 default,自然就過了

Lastor
但還是很納悶,明明初始就有值,會啥 Vue 會回說沒拿到,這估計會是個需要研究很久的坑


Lastor
而且我去翻那個變數的來源,前人的寫法有防說沒值會給預設

Lastor
也就是我後面組件去拿的時候,不可能會是 undefined 啊。但現實就是收到了未定義

Lastor
還是說我是抓到 Vue2 的 bug 了
