Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Day5: Svelte 生命週期方法
Search
Kalan
September 14, 2020
Programming
120
0
Share
Day5: Svelte 生命週期方法
Svelte 元件當中有各式各樣的生命週期方法,可以在各個時間點呼叫達到不同功能。
Kalan
September 14, 2020
More Decks by Kalan
See All by Kalan
單頁式應用中的無障礙設計
kjj6198
0
820
選擇 Svelte 的三個理由 - JSDC
kjj6198
0
390
Svelte - 如何在前端框架中脫穎而出 | ModernWeb'21
kjj6198
0
210
状態管理を楽にする道
kjj6198
1
420
Day25. 如何解析 HTML 語法
kjj6198
0
160
Day24. Svelte 如何編譯程式碼(2)
kjj6198
0
220
Svelte 如何編譯程式碼(1)
kjj6198
0
230
Day22. Svelte 經驗談
kjj6198
0
200
Day18. UI 實戰篇 - 圖片檢視器
kjj6198
0
190
Other Decks in Programming
See All in Programming
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
290
Swift Concurrency Type System
inamiy
1
550
The Less-Told Story of Socket Timeouts
coe401_
3
640
事業会社でのセキュリティ長期インターンについて
masachikaura
1
270
アーキテクチャモダナイゼーションとは何か
nwiizo
19
5.5k
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
160
NakouPAY説明用
annouim0
0
270
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
800
第3木曜LT会 #28
tinykitten
PRO
0
110
ドメインイベントでビジネスロジックを解きほぐす #phpcon_odawara
kajitack
3
800
Claude Codeをカスタムして自分だけのClaude Codeを作ろう
terisuke
0
150
レガシーPHP転生 〜父がドメインエキスパートだったのでDDD+Claude Codeでチート開発します〜
panda_program
0
1.1k
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
141
7.4k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.5k
Done Done
chrislema
186
16k
The Limits of Empathy - UXLibs8
cassininazir
1
310
Leo the Paperboy
mayatellez
7
1.7k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
The Language of Interfaces
destraynor
162
26k
Design in an AI World
tapps
1
200
Deep Space Network (abreviated)
tonyrice
0
120
The Curse of the Amulet
leimatthew05
1
12k
Designing Powerful Visuals for Engaging Learning
tmiket
1
350
Transcript
第 12 屆 IT 鐵⼈賽 30 天從 0 到 1
學 Svelte Day5 - ⽣命週期⽅法
第 12 屆 IT 鐵⼈賽 本⽇⽬標 學習 Svelte 當中的⽣命週期⽅法
第 12 屆 IT 鐵⼈賽 ⽣命週期執⾏順序 初始化:beforeUpdate → onMount →
afterUpdate 元件更新:beforeUpdate → afterUpdate 元件銷毀:onDestroy
第 12 屆 IT 鐵⼈賽 ⽣命週期概覽 onMount, beforeUpdate, afterUpdate, onDestroy,
tick
第 12 屆 IT 鐵⼈賽 onMount 在 Svelte 元件掛載時呼叫 onMount
函數不會在 SSR 呼叫 如果有回傳函式,會在 unmount 時呼叫
第 12 屆 IT 鐵⼈賽 beforeUpdate 在狀態更新後,元件更新前執⾏ 會在 onMount 之前執⾏(初始化時)
第 12 屆 IT 鐵⼈賽 afterUpdate 狀態更新後,元件更新後執⾏
第 12 屆 IT 鐵⼈賽 onDestroy 元件銷毀時執⾏