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
Day3: DOM 事件綁定、客製化事件、await block 語法教學
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kalan
September 12, 2020
Programming
0
260
Day3: DOM 事件綁定、客製化事件、await block 語法教學
介紹 Svelte 當中的 DOM 事件綁定、客製化事件與 await block 語法教學
Kalan
September 12, 2020
Tweet
Share
More Decks by Kalan
See All by Kalan
單頁式應用中的無障礙設計
kjj6198
0
810
選擇 Svelte 的三個理由 - JSDC
kjj6198
0
380
Svelte - 如何在前端框架中脫穎而出 | ModernWeb'21
kjj6198
0
200
状態管理を楽にする道
kjj6198
1
410
Day25. 如何解析 HTML 語法
kjj6198
0
160
Day24. Svelte 如何編譯程式碼(2)
kjj6198
0
220
Svelte 如何編譯程式碼(1)
kjj6198
0
220
Day22. Svelte 經驗談
kjj6198
0
190
Day18. UI 實戰篇 - 圖片檢視器
kjj6198
0
180
Other Decks in Programming
See All in Programming
Raku Raku Notion 20260128
hareyakayuruyaka
0
370
Best-Practices-for-Cortex-Analyst-and-AI-Agent
ryotaroikeda
1
110
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
150
CSC307 Lecture 10
javiergs
PRO
1
660
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
1
1k
AgentCoreとHuman in the Loop
har1101
5
250
2026年 エンジニアリング自己学習法
yumechi
0
140
CSC307 Lecture 04
javiergs
PRO
0
660
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
230
CSC307 Lecture 03
javiergs
PRO
1
490
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
480
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.5k
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
187
22k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
210
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
350
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Between Models and Reality
mayunak
1
200
We Are The Robots
honzajavorek
0
170
Transcript
第 12 屆 IT 鐵⼈賽 30 天從 0 到 1
學 Svelte Day3 事件綁定、客製事件與 await 語法應⽤
第 12 屆 IT 鐵⼈賽 本⽇⽬標 學習事件綁定、客製化事件、await block 的使⽤
第 12 屆 IT 鐵⼈賽 事件綁定 on:event 名稱 可以接收 script
裡頭定義的函數 也可以使⽤表達式 Svelte 會幫忙處理事件的註冊和銷毀
第 12 屆 IT 鐵⼈賽 事件綁定 - modifier 透過語法輔助減少樣板代碼 preventDefault
- 取消預設⾏為 stopPropgation - 取消冒泡 capture - 在捕捉階段觸發事件 once - 執⾏⼀次事件監聽器 self - 在 e.target 為⾃⼰時才會觸發 可以串接多個 modifier
第 12 屆 IT 鐵⼈賽 客製化事件 可以監聽元件⾃定義的事件 createEventDispatcher:背後為 DispatchEvent 與
CustomEvent 的封裝(MDN ⽂件) dispatch('事件名稱', {參數}) 可以⽤ e.detail.xxx 取得
第 12 屆 IT 鐵⼈賽 事件應⽤練習 https://svelte.dev/repl/hello-world?version=3.25.0
第 12 屆 IT 鐵⼈賽 await block 簡化 Promise 的樣板語法
第 12 屆 IT 鐵⼈賽 await block 應⽤ 串接 Github
API 並顯⽰在畫⾯當中