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
チンパンジーでもわかるVue.js
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Fukuda Naoto
August 29, 2018
Technology
320
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
SONiC Scale-Up Working Group から探る Scale-UpやUltraEthernet機能の実装方法
ebiken
PRO
2
400
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
2k
エラーバジェットのアラートのタイミングを考える.pdf
kairim0
0
170
MCP Appsを作ってみよう
iwamot
PRO
4
690
自分が詳しくない領域でAIを使う #プロヒス2026
konifar
6
1.6k
SteampipeとExcel Power QueryでAWS構成定義書の作成を自動化する
jhashimoto
0
140
2026 TECHFRESH 畢業分享會 - AI-Native 重塑軟體工程與虛擬講師
line_developers_tw
PRO
0
1.3k
MUSUBI 田中裕一『AIと共に行う「しごとのリデザイン」- スモールバックオフィス編』AI Ops Lab #4
musubi
0
230
スタートアップにAmazon EKSは早すぎる? マルチプロダクト戦略を加速する Platform Engineeringの実践 / Is Amazon EKS Too Soon for Startups? Practical Platform Engineering to Accelerate a Multi-Product Strategy
elmodev09
0
190
AIネイティブな開発のサプライチェーンリスク対策 〜激動の開発現場でリスクに立ち向かう〜【ZennFes】
cscengineer
PRO
2
140
Bucharest Tech Week 2026 - Reinventing testing practices in the AI era
edeandrea
PRO
1
170
AIAU_UMEMOGU_ninomiya_slide
ninomiya_ii
0
220
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Exploring anti-patterns in Rails
aemeredith
3
410
What's in a price? How to price your products and services
michaelherold
247
13k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
56k
A Tale of Four Properties
chriscoyier
163
24k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
250
Abbi's Birthday
coloredviolet
2
8.1k
Believing is Seeing
oripsolob
1
150
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Building Applications with DynamoDB
mza
96
7.1k
Faster Mobile Websites
deanohume
310
31k
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もいいぞ