Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Vue.jsで直接DOM操作 したい時のTips
Search
SoichiroKatsuki
September 13, 2018
4.4k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Vue.jsで直接DOM操作 したい時のTips
FukuokaJS #6 のLT資料です。
SoichiroKatsuki
September 13, 2018
Transcript
11 slides
Vue.jsͰDOMૢ࡞ ͍ͨ࣌͠ͷTips FukuokaJS #6 2018/09/13 Ճ݄ फҰ
ࣗݾհ ʲ໊લʳ ɹՃ݄ फҰɹɹˏZuckey_ ʲॴଐʳ ɹגࣜձࣾJετϦʔϜ ʲ;ͩΜ͍ͬͯΔͷʳ ɹC# Azure ͳͲ
ʲझຯʳ ɹϩʔυόΠΫɾےτϨ
Vue.js ͬͯ·͔͢ʁ
DOMΛҙࣝ͠ͳͯ͘ྑͯ͘ ͍͍͢Ͱ͢ΑͶʂ
Ͱͨ·ʹDOMΛૢ࡞ͤ͟Δ Λಘͳ͍ͱ͖ͳ͍Ͱ͔͢ʁ
͔ͤͬ͘Vue.jsͬͯΔͷʹDOMૢ࡞ʁ ɾDOMૢ࡞͢ΔλΠϓͷCSSϑϨʔϜϫʔΫ ɹ͕Ͳ͏͍͍ͯͨ͠ɹ ɹɹʢMaterialize, BootstrapͳͲʣ ɾ༻ͮ͠Β͍ϓϥάΠϯ͕ඞཁɹ ɹɹʢಈըϓϨΠϠʔͳͲʣ
ᶃ inputͷͷJS͔Βͷมߋʹҙ ɾVue.jsΛհͣ͞ʹ֎෦ͷJS͔ΒinputͷΛมߋ ɹͨ͠߹ɺVue.jsଆͰมߋ͕ݕ͞Εͳ͍ͷͰɺ ɹv-on:channgeͰϞσϧͷΛߋ৽͢Δ
ᶄ ΧελϜσΟϨΫςΟϒΛ͏ ɾDOM͕࣮֬ʹ͋Δ͜ͱΛલఏʹͨ͠ૢ࡞ ΧελϜσΟϨΫςΟϒͷinsertedͰߦ͏ ϑοΫؔͷछྨͳͲৄͪ͘͜͠Β https://jp.vuejs.org/v2/guide/custom-directive.html
ᶅ beforeDestroyΛ͏ ɾొ͍ͯͨ͠ΠϕϯτϦεφʔΛ ɹremoveEventListenerͰআ͢Δ ɾϓϥάΠϯͷDOMΠϯελϯεΛআ͢Δ ɹॲཧΛߦ͏
ᶆDOMΛݩʹ͍ͨ࣌͠v-ifͰ ɾ֎෦ͷJSͰߦͬͨ ɹDOMͷมߋΛ ɹϦηοτ͍ͨ͠ ɹͱ͖v-ifΛ͏
·ͱΊ ɾۃྗDOMΛૢ࡞͢Δͷ ɹ߇͑·͠ΐ͏ʂ ɾͲ͏ͯ͠ૢ࡞͠ͳ͍ͱ͍͚ͳ͍ ɹͱ͖ʹհͨ͠Tips͕ʹཱͯ ɹ͏Ε͍͠Ͱ͢
More Decks by SoichiroKatsuki
See All by SoichiroKatsuki
FukuokaJS #11 今さら聞けないWebP対応
soichirokatsuki
0
130
画像の遅延 ローディングの話
soichirokatsuki
1
460
VueのUIフレームワークを試してみた
soichirokatsuki
1
750
Azureでお手軽動画配信
soichirokatsuki
1
420
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
660
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.9k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
Become a Pro
speakerdeck
PRO
31
6.4k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2.1k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
530
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
760
Odyssey Design
rkendrick25
PRO
3
980
The Pragmatic Product Professional
lauravandoore
37
7.5k
Code Review Best Practice
trishagee
74
20k
Heart Work Chapter 1 - Part 1
lfama
PRO
11
37k