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
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Fukuda Naoto
August 29, 2018
Technology
330
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
チンパンジーでもわかるVue.js
デジコン合宿
Fukuda Naoto
August 29, 2018
More Decks by Fukuda Naoto
See All by Fukuda Naoto
Git&GitHub勉強会
never9612
0
130
Other Decks in Technology
See All in Technology
UniFi(ユニファイ)AIカメラの現場活用
ludicmind
1
380
実体験から学ぶ分析エージェントの開発と運⽤
recruitengineers
PRO
8
1.8k
会社説明資料
persolserverworks
0
9.6k
FactoryBotアンチパターン / factory_bot anti-patterns
toshimaru
0
140
V8のArray.prototype.flatを最大約20倍速くするまでと、巨大OSSへの大規模コミットの道のり
riyaamemiya
0
110
Loop Engineering これくらいでいい
mikanichinose
0
150
ハードウェアコンペでもAI駆動開発が進んでいる話
iotengineer22
1
640
今さら理解するウェブフォントver.2026
takanorip
3
510
Snapshot Testing in Practice: Predictable and Reliable SwiftUI Views
fespinoza
0
170
SREでアラート疲れを 解決しよう!
kairim0
1
220
Claude Code本は、どのように執筆チームで書かれたか
oikon48
1
350
分析の民主化を支えるメタデータ整備の実践
kakehashi
PRO
4
1.2k
Featured
See All Featured
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
260
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
510
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
550
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Writing Fast Ruby
sferik
630
63k
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Transcript
チンパンジーでもわかるVue.js
そもそもVue.jsってなんぞや
うるせ~~! 知らね~~!
これまでのWebページ .htmlファイルにHTMLを書く ↓ CSSで見た目を整える ↓ JS(またはJQuery)で動きをつけたりサーバとの通信したり
Vue.jsだと なんかJSとHTMLがうまい感じにつながってくれる (双方向バインディング)
とりあえず手を動かせ index.html <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>
チンパンジーでもわかるVue.js</title> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js" </head> <body> <div id="app"> <p>{{ message }}</p> </div> <script src="script.js"></script> </body> </html>
script.js const app = new Vue({ el: '#app', data: {
message: 'Hello Vue!' } })
テキストボックスで双方向バインディングを 感じろ <div id="app"> <input v-model="message" /> <p>{{ message }}</p>
</div>
クリックしたときのアクション <div id="app"> <input v-model="message" /> <button v-on:click="deleteString"> 削除</button> <p>{{
message }}</p> </div> const app = new Vue({ el: '#app', data: { message: 'Hello Vue!' }, methods: { deleteString: function(){ this.message = ''; } } })
HTMLタグの属性に変数使いたくない? <div id="app"> <input v-model="message" v-bind:maxlength="maxLength"/> <button v-on:click="deleteString"> 削除</button> <progress
v-bind:max="maxLength" v-bind:value="message.length <p>{{ message }}</p> </div
data: { message: 'Hello Vue!', maxLength: 20, }
ここまでのディレクティブまとめ v‑on:イベント v‑bind:属性 v‑model 実はv‑onとv‑bindを組み合わせているだけ
Q.いちいち書くのめんどくさい A.v‑onとv‑bindは短縮記法あるで <button v-on:click="deleteString"> 削除</button> <progress v-bind:max="maxLength" v-bind:value="message.length" <button @click="deleteString">
削除</button> <progress :max="maxLength" :value="message.length"></progress>
要素の表示・非表示を操れ methods: { deleteString: function(){ this.message = ''; }, toggleVisible:
function(){ this.isVisible = !this.isVisible; } } <button @click="toggleVisible">{{ isVisible ? ' 非表示' : ' 表示' <p v-if="isVisible">{{ message }}</p>
超便利!配列を展開する <ol> <li v-for='animal in animals'>{{ animal }}</li> </ol> data:
{ message: 'Hello Vue!', maxLength: 20, animals:[' チンパンジー',' ゴリラ',' サル'] }
ディレクティブまとめ v‑if trueで要素表示、falseで要素非表示 v‑for 配列の要素 in 配列 で配列の文だけHTMLの要素が展開される
まとめ Vue.jsはいいぞ Reactもいいぞ