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-example
Search
maeken2010
December 11, 2019
Programming
1.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
vue-example
maeken2010
December 11, 2019
More Decks by maeken2010
See All by maeken2010
見ると観察
maeken2010
1
85
Other Decks in Programming
See All in Programming
JavaDoc 再入門
nagise
0
300
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
260
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
510
3Dシーンの圧縮
fadis
1
670
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
170
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
150
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
220
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
320
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
140
New "Type" system on PicoRuby
pocke
1
680
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
460
Technical Debt: Understanding it Rightly, Engaging it Rightly #LaravelLiveJP
shogogg
0
200
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
180
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
170
Making Projects Easy
brettharned
120
6.7k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Navigating Team Friction
lara
192
16k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
How to build a perfect <img>
jonoalderson
1
5.6k
Mind Mapping
helmedeiros
PRO
1
240
Are puppies a ranking factor?
jonoalderson
1
3.5k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
300
Transcript
Object-base <template> <div @click="plus">{{ count }} {{ double }}</div> </template>
<script> export default { data: function() { return { count: 0 } }, computed: { double: function() { return this.count * 2 } }, methods: { plus: function() { this.count++ } } } </script>
Composition <template> <div @click="plus">{{ state.count }} {{ state.double }}</div> </template>
<script> import { reactive, computed } from 'vue' export default { setup() { const state = reactive({ count: 0, double: computed(() => state.count * 2) }) function plus() { state.count++ } return { state, plus } } } </script>
Class-base <template> <div @click="plus">{{ count }} {{ double }}</div> </template>
<script> import Vue from 'vue' export default class App extends Vue { count = 0 get double() { return this.count * 2 } plus() { this.count++ } } </script>
<template> <div @click="plus">{{ count }} {{ double }}</div> </template> <script>
export default { data: function() { return { count: 0 } }, computed: { double: function() { return this.count * 2 } }, methods: { plus: function() { this.count++ } } } </script> <template> <div @click="plus">{{ count }} {{ double }}</div> </template> <script> import Vue from 'vue' export default class App extends Vue { count = 0 get double() { return this.count * 2 } plus() { this.count++ } } </script> <template> <div @click="plus">{{ state.count }} {{ state.double }}</div> </template> <script> import { reactive, computed } from 'vue' export default { setup() { const state = reactive({ count: 0, double: computed(() => state.count * 2) }) function plus() { state.count++ } return { state, plus } } } </script> Object-base Class-base Composition