linux

Vue 更新 ref 中的「整個」array 時失效

情況 there are 2 files below, when I import a const object (called COMMON) to update an array content in another object of...
linux

Vue Writable computed

限制:getter的返回值與setter 的參數要一致。 e.g. 下例都是 string、不然 editor compiler 會叫錯 <script setup> import { ref, computed } from 'vue' ...
linux

Vue Computed vs Methods

同一個 component 中、Computes 有在內部作 cache,Methods 沒有,所以 template 在 render 時不用每次呼叫,計算成本較低 the difference is thatcomputed prope...
linux

Vue 建立很多 child-components 對效能的影響??

因為每一個 Vue 元件都會有一個對應的 watcher 來查看 Virtual DOM 與 Real DOM 的關聯,建立很多個子元件時也表示會建立很多個 Vue Instance 關於會不會影響到效能或吃掉大量記憶體,目前還不完全清楚 ...
linux

Vue inheritAttrs: false 繼承

用在:html 有複數層的子元件,加上inheritAttrs: false 的話才能將 native attribute 透過 $attr 傳入第二層的 html tag 中、且不會影響第一層的 label Vue2 例如下方範例的 re...
linux

Vue Component 的命名轉換

使用 VTextArea 時,compiler會出錯,說找不到 component Vue 的內部轉換中,casemal 和檔名的 kebab 是一對的 VTextarea === v-textareaVTextArea === v-tex...
linux

Vue3 生命週期

官方文件中有說明 Composition API 中的生命週期有哪些:簡單說、Vue3 把 created 類的拿掉了 Options APIComposition API inside setupbeforeCreate無created無...
programming

5分鐘理解 Async-Await (Javascript / Typescript)

同步 vs 非同步 一個程序需要等待另一個進程完成,然後在同步模型中執行其他操作。反之,非同步則不然。 (下面將用同步和異步來描述。 image source Concept of async programming 同步函數 functi...
programming

VueJS v-model 語法糖

v-model 只是語法糖,省去每次寫 :value="xxx" @input="ooo" 這些語法,用來自動處理 input / output v-model 預設的 prop: value, emit-event: input expo...
programming

VueJs delay input search 延遲搜尋

一般的實作會用 v-model="searchedEmail",然後 listen inputed 的變化後向 server 發送值 問題點:每輸入一個字元就向自已的 server 發送 request,連續一直輸入,其實就是自體DDoS攻...