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
More Decks by SoichiroKatsuki
See All by SoichiroKatsuki
FukuokaJS #11 今さら聞けないWebP対応
soichirokatsuki
0
120
画像の遅延 ローディングの話
soichirokatsuki
1
450
VueのUIフレームワークを試してみた
soichirokatsuki
1
750
Azureでお手軽動画配信
soichirokatsuki
1
420
Featured
See All Featured
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.5k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
A designer walks into a library…
pauljervisheath
211
25k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
Making the Leap to Tech Lead
cromwellryan
135
10k
Embracing the Ebb and Flow
colly
88
5.2k
Paper Plane
katiecoart
PRO
5
54k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.7k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
470
Transcript
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͕ʹཱͯ ɹ͏Ε͍͠Ͱ͢